我有这个网格视图:
<GridView android:id="@+id/gridEtebarSanji"
android:layout_width="match_parent"
android:layout_height="480dp"
android:background="@color/black"
android:gravity="center"
android:horizontalSpacing="2dp"
android:isScrollContainer="false"
android:numColumns="3"
android:stretchMode="columnWidth"
android:verticalSpacing="2dp" >
</GridView>
此布局用于其中的项目:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_horizontal" >
<TextView
android:id="@+id/tvText"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:singleLine="false"
android:text="TextView"
android:textSize="16dip" />
</LinearLayout>
结果:
我想将单行单元格拉伸到与多行单元格一样长。我怎样才能做到这一点?
我已经设定android:layout_height="match_parent"
对于 textViews 但它不影响。
将 TextView 设置为显示 2 行:
<TextView
android:id="@+id/tvText"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:lines="2"
android:text="TextView"
android:textSize="16dip" />
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)