开发者

How to create 3 equally wide TextView which fill parent across the screen

开发者 https://www.devze.com 2022-12-30 03:27 出处:网络
HI, Can you please tell me how can I create 3 equally wide TextView which fill parent across the screen? I tried doing this, but the width of the TextView are different: it is 149, 89, 89.

HI,

Can you please tell me how can I create 3 equally wide TextView which fill parent across the screen? I tried doing this, but the width of the TextView are different: it is 149, 89, 89.

<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="fill_parent" android:layout_height="wrap_content"
     android:stretchColumns="*"
     android:shrinkColumns="*">

开发者_如何学Python
<TextView android:id="@+id/t1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_column="0"/>

<TextView android:id="@+id/t2"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_column="1"/>

<TextView android:id="@+id/t3"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_column="2"/>


<LinearLayout
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content"
    >
    <TextView
        android:layout_height="wrap_content"
        android:layout_width="0dp"
        android:layout_weight="1"
    />
    <TextView
        android:layout_height="wrap_content"
        android:layout_width="0dp"
        android:layout_weight="1"
    />
    <TextView
        android:layout_height="wrap_content"
        android:layout_width="0dp"
        android:layout_weight="1"
    />
</LinearLayout>
0

精彩评论

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