我希望我的標簽布局出現在我的螢屏頂部。目前它位于螢屏底部。試了幾種方法都不行。我怎樣才能讓它出現在我的螢屏上。
xml檔案的代碼
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".kanbanManagement">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.viewpager2.widget.ViewPager2
android:layout_width="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="0dp"
android:id="@ id/viewPager2"
android:layout_weight="1" />
<com.google.android.material.tabs.TabLayout
android:id="@ id/tabLayout"
android:layout_width="match_parent"
android:layout_height="50dp"
app:tabGravity="fill"
app:tabIndicator="@drawable/tab_indicator"
app:tabIndicatorAnimationMode="elastic"
app:tabIndicatorGravity="stretch"
app:tabMode="fixed"
app:tabSelectedTextColor="@color/white" />
</LinearLayout>
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/hello_blank_fragment" />
</FrameLayout>
uj5u.com熱心網友回復:
您好,只需將 tabs 標簽放在視圖尋呼機的頂部,如下所示:
<com.google.android.material.tabs.TabLayout
android:id="@ id/tabLayout"
android:layout_width="match_parent"
android:layout_height="50dp"
app:tabGravity="fill"
app:tabIndicator="@drawable/add_signature_icon"
app:tabIndicatorAnimationMode="elastic"
app:tabIndicatorGravity="stretch"
app:tabMode="fixed"
app:tabSelectedTextColor="@color/white" />
<androidx.viewpager2.widget.ViewPager2
android:layout_width="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="0dp"
android:id="@ id/viewPager2"
android:layout_weight="1" />
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/481322.html
上一篇:ExcelOffice.js-多個背景關系選單項控制問題
下一篇:最終模式匹配后將字串添加到新行
