现在每行的宽度根据文本的大小而变化。但是我希望每个列都有固定的大小,比如excel。应该改变什么?它不应该被match_parent因为家长有非常大的宽度..如何修复色谱柱宽度?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:textAppearance="?attr/textAppearanceListItem" />
<TextView
android:id="@+id/email"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:textAppearance="?attr/textAppearanceListItem" />
<TextView
android:id="@+id/short_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:textAppearance="?attr/textAppearanceListItem" />
</LinearLayout>
编辑
当前版本它表明类似
Chris [email protected] R
Apostole [email protected] -
但我要的是
Chris [email protected] R
Apostole [email protected] -
我试过@Priyank Prajapati的版本,但它s直到给前者布局
添加静态宽度 –
所有textviews变化'的android:layout_width = match_parent'并添加'机器人:体重= 1' –
变化'layout_width = “0dp”'和'添加layout_weight = “1”'; –