开发者

Android table background color

开发者 https://www.devze.com 2023-02-17 11:43 出处:网络
To simulate a grid, I have a tablelayout with background #ffffff, tablerow with background #000000 and textviews with backgroun开发者_如何学Pythond #dcdcdc.

To simulate a grid, I have a tablelayout with background #ffffff, tablerow with background #000000 and textviews with backgroun开发者_如何学Pythond #dcdcdc.

The entire cell is colored #dcdcdc when the textview has width and height set in fill_parent, but when I add the attribute layout_gravity=center, the width fill_parent attribute is discarded. How can I center the text keeping the whole cell with the expected color?


If i understand correctly...you can use

android:gravity="center"

on the TextView to center the text in the view.

0

精彩评论

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