开发者

how to add a tableRow in a tableRow?

i want to make a table like that:

how to add a tableRow in a tableRow?

i have tried something like that but is not working...

        <TableRow>


            <TextView
            android:textColor="#fed570"

                android:text="days"
               android:padding="3dip"  
               android:textStyle="bold"/>



    <TextView>

              <TableRow>

            <TextView
            android:textColor="#fed570"

                android:text="1"
               android:padding="3dip"  
               android:textStyle="bold"/>
            <Te开发者_StackOverflow社区xtView
            android:textColor="#fed570"

                android:text="2"
                android:gravity="center"
                android:padding="3dip"   android:textStyle="bold"/>


//..more days
             </TableRow>

    </TextView>
        </TableRow>

</TextView>
    </TableRow>

Is that possible to be created?


Seems like you don't need everything to be a TableRow, you can do the days as a simple TextView in the TableLayout. Since rows are built of columns putting all of the numbers into one row is what you will want, The letters "A, B, C" can be the actual rows to hold your incoming data. Something more like..

<?xml version="1.0" encoding="utf-8"?>
<TableLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="#ffffffff">
    <TextView
        android:textColor="#fed570"
        android:text="days"
        android:padding="3dip"
        android:textStyle="bold" android:gravity="center"/>
    <TableRow>
        <TextView
            android:textColor="#fed570"
            android:text="Type"
            android:gravity="center"
            android:padding="3dip"
            android:textStyle="bold"/>  
        <TextView
            android:textColor="#fed570"
            android:text="1"
            android:gravity="center"
            android:padding="3dip"
            android:textStyle="bold"/>
        <TextView
            android:textColor="#fed570"
            android:text="2"
            android:gravity="center"
            android:padding="3dip"
            android:textStyle="bold"/>
        <TextView
            android:textColor="#fed570"
            android:text="3"
            android:padding="3dip"
            android:textStyle="bold"/>
        <TextView
            android:textColor="#fed570"
            android:text="4"
            android:gravity="center"
            android:padding="3dip"
            android:textStyle="bold"/>
        <TextView
            android:textColor="#fed570"
            android:text="5"
            android:padding="3dip"
            android:textStyle="bold"/>
        <TextView
            android:textColor="#fed570"
            android:text="6"
            android:gravity="center"
            android:padding="3dip"
            android:textStyle="bold"/>
        <TextView
            android:textColor="#fed570"
            android:text="7"
            android:padding="3dip"
            android:textStyle="bold"/>                          
    </TableRow>
    <TableRow>
        <TextView
            android:textColor="#fed570"
            android:text="A"
            android:gravity="center"
            android:padding="3dip"
            android:textStyle="bold"/>
    </TableRow>
    <TableRow>
        <TextView
            android:textColor="#fed570"
            android:text="B"
            android:gravity="center"
            android:padding="3dip"
            android:textStyle="bold"/>
    </TableRow>
    <TableRow>
        <TextView
            android:textColor="#fed570"
            android:text="C"
            android:gravity="center"
            android:padding="3dip"
            android:textStyle="bold"/>
    </TableRow>     
</TableLayout>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜