Android 如何防止元素隐藏在透明的actionbar后面
我的布局有问题。我在我的应用程序中使用ViewPager选项卡布局,我想使用透明的操作栏。我设法防止元素隐藏在操作栏后面,但问题是元素隐藏在选项卡栏后面。如何修复它 xml文件Android 如何防止元素隐藏在透明的actionbar后面,android,xml,android-layout,android-actionbar,Android,Xml,Android Layout,Android Actionbar,我的布局有问题。我在我的应用程序中使用ViewPager选项卡布局,我想使用透明的操作栏。我设法防止元素隐藏在操作栏后面,但问题是元素隐藏在选项卡栏后面。如何修复它 xml文件 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:paddingTop="?android:attr/ac
<?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\u behavior=“@string/appbar\u scrolling\u view\u behavior”
,其中xmlns:app=”http://schemas.android.com/apk/res-auto"
您是否尝试在版面顶部添加边距?@joao2fast4u我在版面顶部添加了填充,部分效果良好。我认为解决方案应该是两倍于这个填充,但我不知道如何在XML文件中实现它。我在您的布局中没有看到任何填充。你能给我看看viewpager的布局吗?