Home  >  Q&A  >  body text

Android中如何实现模板activity?

大家讲道理大家讲道理2715 days ago265

reply all(2)I'll reply

  • 迷茫

    迷茫2017-04-17 15:42:38

    If you just ask about the Taobao app, its product details page is actually a web page, so what should be discussed is the web page template. Activity only hosts the framework webview. If you are asking about using native Activity to implement a product details page similar to Taobao, then you have to consider more. First, summarize the common information of the products. For example, there are poster previews, keyword tags, and the increase or decrease in the number of shopping carts. They all have business information, product introductions, etc., and they are all displayed in fixed locations, so just define a fixed layout. The Activity receives different product IDs, requests the product details data of this ID from the background, and binds the corresponding Just display it. Of course, the actual situation is much more complicated. Different product categories should have different display methods, such as clothing and food. They may require different pages to distinguish the differences, so they need to be designed separately. E-commerce product detail pages are basically implemented as web pages, which are more flexible.

    reply
    0
  • 天蓬老师

    天蓬老师2017-04-17 15:42:38

    If it is native NATIVE, use Fragment
    If it is HTML5, use WebView

    reply
    0
  • Cancelreply