开发者

Create an android ListView with margins that aren't applied to the header

I currently have a ListView in Android with a LinearLayout as a header. I would like to have a left and right margin apply to the items in the ListView, but not to the header. Is there any easy way to do this? One approach I attempted was wrapping the list items in LinearLayout, but that caused a class cast exception at开发者_开发问答 runtime.


You can set the padding attribute on your ListView without affecting the parent layout. You also should be able to embed a linear layout within your parent layout but thats a seperate issue


Try adding left/right padding to the row view layout.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜