我想要一个布局,其中我有一个ListView和我自己的视图在屏幕的底部。我的问题是,fastScrollIndicator没有考虑到我在ListView底部放置的50dp填充,因此当我滚动到列表底部时,视图会将其隐藏。你知道我能在这里做什么吗?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ListView
android:id="@+id/android:list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingBottom="50dp"
/>
<LinearLayout android:layout_width="fill_parent" android:id="@+id/buttonContainer" android:layout_height="50dp" android:background="@drawable/gradient_blue" android:orientation="horizontal" android:layout_alignParentBottom="true">
<ImageButton android:layout_height="match_parent" android:background="#00000000" android:layout_width="0dp" android:id="@+id/leftButton" android:layout_weight="1"></ImageButton>
<ImageButton android:layout_height="match_parent" android:background="#00000000" android:layout_width="0dp" android:id="@+id/middleButton" android:layout_weight="1"></ImageButton>
<ImageButton android:layout_height="match_parent" android:background="#00000000" android:layout_width="0dp" android:id="@+id/rightButton" android:layout_weight="1"></ImageButton>
</LinearLayout>
</RelativeLayout>发布于 2011-06-28 22:39:40
您的问题是填充是在视图内部计算的,在这种情况下,您实际上想要做的是使用android:layout_marginBottom。边距是从视图外部计算的,填充是从内部计算的。
希望能有所帮助。
发布于 2014-01-28 00:58:46
试试这个:
<ListView
android:id="@+id/android:list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingBottom="50dp"
android:scrollbarStyle="insideInset"
/>https://stackoverflow.com/questions/6507227
复制相似问题