Tôi đã theo dõi this tutorial. Tôi đã thực hiện thay đổi đơn giản hiển thị TabLayout ở cuối màn hình.Cách hiển thị chỉ báo tab ở trên cùng của Tab
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v4.view.ViewPager
android:id="@+id/viewpager_landing"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="1"
android:background="@android:color/white" />
<android.support.design.widget.TabLayout
android:id="@+id/sliding_tabs_landing"
style="@style/MyCustomTabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabMode="fixed" />
</LinearLayout>
Vấn đề: -
TabIndicator
đang hiển thị ở phía dưới của màn hình làm việc tốt, Bây giờ tôi muốn chứng minh rằng TabIndicator
tại Đầu Tabs khá hơn đáy. Sử dụng bố cục tùy chỉnh, chúng tôi có thể thực hiện điều đó như đã đề cập trong hướng dẫn nhưng có bất kỳ thuộc tính xml nào sẽ hiển thị TabIndicator
ở trên cùng không?
đặt mã xml của bạn. thx – Fakher
@Fakher Tôi đã đăng xml –
@Nilesh Bạn đã đạt được điều này? Tôi cũng muốn hiển thị chỉ báo tab ở trên cùng. –