开发者

align listview to the center

I have an android application that uses a custom listview. All I want to do is to make this listview aligning center and not filling all the window (horizontal). for tha开发者_如何学运维t purpose I set padding

 list.setPadding(20, 0, 20, 0);
    list.setBackgroundColor(Color.RED);

I want to set up a background color for space that listview in and another background for the padding space. when I write the above code only on click the main content background returning to black. How do I accomplish that? Thanks


Please check if using margins solves your problem.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜