您的位置:首页 > 其它

ListView居中

2014-05-02 23:48 369 查看
ListView一般需要两个layout文件,一个是textView用于显示每条记录的组件,另一条用一个listView显示一组类似textView的组件。

所以显然,如要要文字居中的话就是textView的事情,用

<pre code_snippet_id="323987" snippet_file_name="blog_20140502_1_9686340" name="code" class="html">android:gravity="center_vertical"设置垂直居中,同样center_horizontal设置水平居中;
如果要设置分隔的话就需要在listView中设置

<pre code_snippet_id="323987" snippet_file_name="blog_20140502_2_5270449" id="best-content-1284358069" class="best-text mb-10" name="code" style="white-space: pre-wrap; word-wrap: break-word; color: rgb(51, 51, 51); font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);">
android:divider设置分割线颜色,android:dividerHeight设置分割高度。








                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  textview listview