我的布局有问题。我在应用程序中使用 ViewPager 选项卡布局,并且我想使用透明操作栏。我设法防止元素隐藏在操作栏后面,但问题是元素门槛隐藏在选项卡栏后面。如何解决?
XML 文件
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:paddingTop="?android:attr/actionBarSize"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
android:background="#E3F6CE">
<ListView
android:id="@+id/listView1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
</ListView>
</LinearLayout>
使用 CoordinatorLayout
包装所有组件,并在 RelativeLayout 中使用此app:layout_behavior="@string/appbar_scrolling_view_behavior"
,其中xmlns:app="http://schemas.android.com/apk/res-auto"