标签:details lin textview androi center tail mat code text
通过一个线性布局将两个TextView控件包装在一起,设置LinearLayout的layout_centerInParent属性为true即可。代码如下
<LinearLayout android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_centerInParent="true" android:orientation="horizontal"> <TextView android:id="@+id/igame_wb_details_activity_tv_title_lol_privilege" android:layout_width="95dp" android:layout_height="match_parent" android:layout_toLeftOf="@+id/igame_wb_details_activity_tv_center" android:textColor="@color/igame_text_normal_color" android:textSize="@dimen/igame_textsize_s" android:text="文本1"/> <TextView android:id="@+id/igame_wb_details_activity_tv_privilege_type" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_toRightOf="@+id/igame_wb_details_activity_tv_title_lol_privilege" android:textColor="@color/igame_normal_op_color" android:layout_marginLeft="5dp" android:textSize="@dimen/igame_textsize_s" android:text="文本2"/> </LinearLayout>
标签:details lin textview androi center tail mat code text
原文地址:http://www.cnblogs.com/longzhongren/p/6157959.html