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.
精彩评论