首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何在ListView中设置垂直滚动条右边缘的边距?

如何在ListView中设置垂直滚动条右边缘的边距?
EN

Stack Overflow用户
提问于 2011-05-12 21:06:40
回答 2查看 14.9K关注 0票数 22

Android平台:

我需要把页边距在列表视图(它是自定义的)垂直滚动条的右侧。请看附件中的图片。默认滚动条位于列表视图的最右侧。

需要你的帮助。谢谢。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2011-05-18 15:11:01

请参考Viewandroid:scrollbarStyle属性上的documentation。您可能要使用的样式是insideOverlay (与android:paddingRight结合使用)。

就像这样

代码语言:javascript
复制
<LinearLayout android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:gravity="center_horizontal"
    android:paddingRight="50dip">
    <ListView
        android:id="@+id/scrollable_table" 
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:scrollbarStyle="insideOverlay">
    .
    .
    .
票数 18
EN

Stack Overflow用户

发布于 2017-07-08 22:52:08

尝试启用快速滚动,它会在大部分时间内完成此工作:

代码语言:javascript
复制
<ListView
    android:id="@+id/chapter_list"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:fastScrollEnabled="true"/>
票数 -2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/5978430

复制
相关文章

相似问题

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