android - Center ListView horizontally -
It's as easy as it sounds, as list of inventory will not be self-centered (or its In-the-content is not - This list item has an item layout: I have tried everything (including layout to simplify max), but it still will not go. It is fun that the first relative layout clock_container - the center attraction of the same, due to the parent's linear letter Added later: inspired by the answer to FOliveira , I have done some investigation and found that: everything works fine, mother In the Nobody knows why he is? p> After keeping the relative layout as the main parent, The mistake you make is that you make the linear gravity baby horizontally for the center, which is correct, but this option only affects the affected children only with a relative layout. & lt ;? xml version = "1.0" encoding = "UTF-8"?>
& Lt; TextView Android: id = "@ + id / btn_text" android: layout_width = "wrap_content" android: layout_height = "wrap_content" style = "@ style / custom_btn_name" /> & Lt; TextView Android: AD = "@ + ID / BTN_ count" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content" style = "@ style / custom_btn_count" /> & Lt; / RelativeLayout & gt;
android: gravity = "center_horizontal" . Why not see the list?
linear layout android: gravity = "center_horizontal" and your children are respectfully left for children of ListView to combine that ListView their
android: layout_width = "wrap_content" attribute, despite all the possible width.
CENTER_IN_PARENT Set the attribute to true.
Comments
Post a Comment