首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >FastScroll和ListView填充

FastScroll和ListView填充
EN

Stack Overflow用户
提问于 2011-06-28 21:30:11
回答 2查看 427关注 0票数 0

我想要一个布局,其中我有一个ListView和我自己的视图在屏幕的底部。我的问题是,fastScrollIndicator没有考虑到我在ListView底部放置的50dp填充,因此当我滚动到列表底部时,视图会将其隐藏。你知道我能在这里做什么吗?

代码语言:javascript
复制
<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>
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2011-06-28 22:39:40

您的问题是填充是在视图内部计算的,在这种情况下,您实际上想要做的是使用android:layout_marginBottom。边距是从视图外部计算的,填充是从内部计算的。

希望能有所帮助。

票数 1
EN

Stack Overflow用户

发布于 2014-01-28 00:58:46

试试这个:

代码语言:javascript
复制
<ListView
android:id="@+id/android:list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingBottom="50dp"
android:scrollbarStyle="insideInset"
/>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6507227

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档