使用填充重新定位 ListView 的滚动条
我有一个 ListView
,其右侧(和左侧)有填充。
目前列表看起来像这样:
----------------- |
| ROW | | |
|-------------| | |
| ROW | | |
|-------------|#| |
| ROW |#| |
|-------------| | |
| ROW | | |
----------------- |
最右边的行是屏幕边缘,# 是滚动条,右侧的空白是 ListView 向右填充。
我是让滚动条位于填充的右侧,如下所示:
_
----------------- | |
| ROW | | |
|---------------| | |
| ROW | |#|
|---------------| |#|
| ROW | |#|
|---------------| | |
| ROW | | |
----------------- |_|
是否可以像这样移动滚动条,或者我是否必须更改每行的布局以获得正确大小的不可见边框?
请注意,目前每一行都有一个由适配器设置的单独背景,因为我正在为我的 ListView
创建一个浮动窗口,不幸的是我的一个屏幕要求我这样做才能让它看起来像我想要的方式。
I have a ListView
with padding to the right (and left).
Currently the list looks something like this:
----------------- |
| ROW | | |
|-------------| | |
| ROW | | |
|-------------|#| |
| ROW |#| |
|-------------| | |
| ROW | | |
----------------- |
Where the right-most line is the edge of the screen, with the #
s being the scrollbar and the white space to the right of it being the ListView
's padding to the right.
What I is for the scroll bar to be to the right of the padding like this:
_
----------------- | |
| ROW | | |
|---------------| | |
| ROW | |#|
|---------------| |#|
| ROW | |#|
|---------------| | |
| ROW | | |
----------------- |_|
Is it possible to move the scrollbar like that or will I have to change the layouts for each row to have an invisible border of the right size?
Note currently each row has a separate background set by the adapter, since I'm making a floating window for my ListView
and unfortunately one of my screens require me to do this in order to get it to look the way I want.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
试试这个:
Try this:
将其添加到您的列表视图中,
它将添加一些填充,并且滚动条将位于外部
add this to your list view
it will add a little padding and the scroll bar will be outside