Android制作网格视图上的actionbar覆盖
我已经使用此工具实现了Android制作网格视图上的actionbar覆盖,android,android-actionbar,android-gridview,Android,Android Actionbar,Android Gridview,我已经使用此工具实现了ActionBar Overlay 在我的片段中,我有一个网格视图定义为 <GridView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingTop="?android:attr/actionBarSize" />
ActionBar Overlay
在我的片段
中,我有一个网格视图
定义为
<GridView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="?android:attr/actionBarSize" />
但是当我向上滚动
网格视图
时,操作栏
似乎不透明,即操作栏
下方看不到网格视图项。但是当我从layout
文件中删除android:paddingTop=“?android:attr/actionBarSize”
时,我确实看到了透明的ActionBar
。那么,对于GridView
,如何正确显示ActionBar覆盖图
。我想在Tumblr Android应用程序中实现gallery select的效果。下面是所附的屏幕截图根据@sandstar提供的建议,执行android:cliptoppadding=false,解决了我的问题。因此,在我的layout.xml
中,我必须编写以下内容
<GridView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:paddingTop="?android:attr/actionBarSize" />
谢谢@sandstar你试过android:clipToPadding=“false”吗?谢谢@sandstar你提供的建议对我有用。
<GridView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:paddingTop="?android:attr/actionBarSize" />