关于GridView里面的一个padding

来源:互联网 发布:linux远程拷贝文件夹 编辑:程序博客网 时间:2024/05/21 06:33

今天在干活的时候,发现gridview里面的内容偏左。用hierarchyviewer发现有个paddingRight,但是怎么也找不到在哪里设置的。

后来发现是因为右侧有个scrollbar,导致会加padding。


下边一段摘自sdk文档,已经说的很明白了,因此改成overlay就好了。


android:scrollbarStyle

Controls the scrollbar style and position. The scrollbars can be overlaid or inset.When inset, they add to the padding of the view. And the scrollbars can be drawn inside the padding area or on the edge of the view. For example, if a view has a background drawable and you want to draw the scrollbars inside the padding specified by the drawable, you can use insideOverlay or insideInset. If you want them to appear at the edge of the view, ignoring the padding, then you can use outsideOverlay or outsideInset.

Must be one of the following constant values.

ConstantValueDescriptioninsideOverlay0x0Inside the padding and overlaidinsideInset0x01000000Inside the padding and insetoutsideOverlay0x02000000Edge of the view and overlaidoutsideInset0x03000000Edge of the view and inset

This corresponds to the global attribute resource symbol scrollbarStyle.

Related methods:

  • setScrollBarStyle(int)

0 0
原创粉丝点击