V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
jack921
V2EX  ›  Android

请问 android 像优酷首页,芒果 TV 首页界面是怎么实现的,是 ListView 嵌套 GridView

  •  
  •   jack921 · 2016-01-18 01:48:47 +08:00 · 5471 次点击
    这是一个创建于 3029 天前的主题,其中的信息可能已经有所发展或是发生改变。
    3 条回复    2016-01-18 09:31:32 +08:00
    kassadin
        1
    kassadin  
       2016-01-18 03:17:27 +08:00   ❤️ 1
    youku,手机,竖屏

    整体 swipe + RecyclerView,内部主要 3 种布局

    1. 首页直接看到的部分
    Gallary + Recycler(10 个 item) + LinearyLayout(4 视频)

    2. 中间各个频道
    有明显分割线,不是 AdapterView ,是 LinearLayout+ViewStub 写死的最多 4 行 8 视频

    3.最后的『推荐』 RecyclerView
    nicegoing
        2
    nicegoing  
       2016-01-18 03:55:52 +08:00   ❤️ 1
    @kassadin 中间的各频道应该是自定义的 ViewGroup 吧,类似微博或微信那种。 viewStub 只能 inflate 一次,没法重用啊。
    kassadin
        3
    kassadin  
       2016-01-18 09:31:32 +08:00
    @nicegoing 不是,你用 ddms 看下就知道了

    <?xml version="1.0"?>
    <LinearLayout android:orientation="vertical" android:background="@color/white" android:layout_width="fill_parent" android:layout_height="wrap_content" xmlns:android="http://schemas.android.com/apk/res/android">
    <com.youku.phone.home.view.HomeCardTitleView android:id="@id/home_card_title_view" android:layout_width="fill_parent" android:layout_height="wrap_content" />
    <ViewStub android:id="@id/home_video_land_item_wide" android:layout="@layout/home_card_item_cross" android:layout_width="fill_parent" android:layout_height="wrap_content" />
    <ViewStub android:id="@id/home_video_land_item_column1" android:layout="@layout/home_card_item_column" android:layout_width="fill_parent" android:layout_height="wrap_content" />
    <ViewStub android:id="@id/home_video_land_item_column2" android:layout="@layout/home_card_item_column" android:layout_width="fill_parent" android:layout_height="wrap_content" />
    <ViewStub android:id="@id/home_video_land_item_column3" android:layout="@layout/home_card_item_column" android:layout_width="fill_parent" android:layout_height="wrap_content" />
    <ViewStub android:id="@id/home_video_land_item_column4" android:layout="@layout/home_card_item_column" android:layout_width="fill_parent" android:layout_height="wrap_content" />
    <ViewStub android:id="@id/home_video_land_item_extend" android:layout_width="fill_parent" android:layout_height="wrap_content" />
    <ViewStub android:id="@id/home_video_land_item_tailer" android:layout="@layout/home_card_item_tail_layout" android:layout_width="fill_parent" android:layout_height="wrap_content" />
    </LinearLayout>
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2558 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 995ms · UTC 14:28 · PVG 22:28 · LAX 07:28 · JFK 10:28
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.