【问题标题】:Nested Scroll View Android Studio嵌套滚动视图 Android Studio
【发布时间】:2018-02-27 01:12:28
【问题描述】:

我怎样才能实现这个设计(黄色箭头)?和(橙色箭头)?它是一个列表视图吗?提前致谢!

【问题讨论】:

  • 黄色是水平滚动还是标签??
  • 在他们的应用程序中对 Paymaya 表示敬意,它是一个标签,先生

标签: listview android-studio android-button android-nestedscrollview


【解决方案1】:

您可以为此使用一个 tablayout 和一个 recyclerview。 或者你可以使用 NestedScrollView。

<android.support.v4.widget.NestedScrollView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:scrollbars="none">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:focusableInTouchMode="true"
        android:orientation="vertical">

    <android.support.design.widget.TabLayout
        android:id="@+id/fragment_manager_tab_bar_tab_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:tabGravity="fill"
       app:tabMode="fixed"
       app:tabTextColor="@color/tab_inactive"
       app:tabSelectedTextColor="@color/tab_active"
       app:tabIndicatorColor="@color/tab_active" />


        <android.support.v7.widget.RecyclerView
            android:id="@+id/product_list"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"
            android:scrollbars="none" />

    </LinearLayout>
</android.support.v4.widget.NestedScrollView>

更多首先fragment_manager_tab_bar_tab_layout显示在这里查看卡片,扫描并充值product_list你可以显示线性布局垂直

更完整的代码,可以参考:

https://inducesmile.com/android-tips/android-recyclerview-inside-nestedscrollview-example/

这个也对你有帮助:

http://android-pratap.blogspot.com/2015/12/horizontal-recyclerview-in-vertical.html

不要错过这个:

https://mzgreen.github.io/2015/02/28/How-to-hideshow-Toolbar-when-list-is-scrolling(part2)/

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多