开发者

How to define column width of TableLayout in my case?

开发者 https://www.devze.com 2023-03-18 21:01 出处:网络
I have a table layout: <TABLELAYOUT xmlns:android=\"http://schemas.android.com/apk/res/android\" android:layout_width=\"fill_parent\"

I have a table layout:

<TABLELAYOUT xmlns:android="http://schemas.android.com/apk/res/android"      

    android:layout_width="fill_parent" 
    android:layout_height="fill_parent">

   <TABLEROW>
       <TEXTVIEW 
           android:layout_width="wrap_content" 
           android:layout_height="wrap_content" 
           android:text="1">

        <TEXTVIEW 
           android:layout_width="wrap_content" 
           android:layout_height="wrap_content" 
           android:text="2">

         <TEXTVIEW 
           android:layou开发者_运维问答t_width="wrap_content" 
           android:layout_height="wrap_content" 
           android:text="3">

         <TEXTVIEW 
           android:layout_width="wrap_content" 
           android:layout_height="wrap_content" 
           android:text="4">
          ...
          <!--there are 10 columns-->
          ...
    </TABLEROW>
</TABLELAYOUT>

There are 10 columns in this table.

My question are:

  1. how can I customize each column width so that only 4 columns show on the screen??

  2. how to set row height?


You can define the size of the first 4 textView by(screenWidth/4).And another 6 as you like.So you will only see the first 4 columns

0

精彩评论

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