【发布时间】:2021-02-01 06:05:06
【问题描述】:
这是我收到的library。
我已经添加了
implementation 'ru.noties:scrollable:1.3.0'
致我的build.gradle。但是,当我实现TabLayout 的ru.noties:scrollable
<ru.noties.scrollable.sample.TabsLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="@dimen/tabs_height"
android:background="@color/md_teal_500"/>
我得到的类是找不到的。我实际上是在尝试使用TabWidget,比如PlayStore。
我想要那个 gif 那样的 TabWidget。怎么做?或者,有没有其他方法可以做到?
我试过了
<TabHost
android:id="@+id/tab_host"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/rl_">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@android:id/tabs">
<LinearLayout
android:id="@+id/Filters"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include
layout="@layout/filters_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:id="@+id/Adjustments"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
layout="@layout/adjustment_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</FrameLayout>
<TabWidget
android:id="@android:id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#40cccccc" />
</RelativeLayout>
</TabHost>
但是,上面的源代码没有给出ScrollableWidget。
我也在youtube 中找到了一个演示。他给了源代码链接http://www.mediafire.com/download/7c1kd878hsvlvzr/tabscroll.rar。但是,我无法访问该链接。
【问题讨论】:
标签: java android tabs widget android-tabhost