开发者

Reposition scroll bar of ListView with padding

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.


Try this:

<ListView
    ...
    android:scrollbarStyle="outsideOverlay" />


add this to your list view

android:scrollbarStyle="outsideInset"

it will add a little padding and the scroll bar will be outside

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜