Android的表格布局ROWSPAN [英] android table layout rowspan

查看:211
本文介绍了Android的表格布局ROWSPAN的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想建立以下布局,但它不能正常工作。

 <的LinearLayout机器人:方向=横向...>
  < ImageView的...>< / ImageView的>
        < TableLayout ...>
                        <的TableRow ..>
                              < ImageView的...>< / ImageView的>
                              < ImageView的...>< / ImageView的>
                              < ImageView的...>< / ImageView的>
                        < /的TableRow>
                         <的TableRow ..>
                              < ImageView的...>< / ImageView的>
                              < ImageView的...>< / ImageView的>
                              < ImageView的...>< / ImageView的>
                        < /的TableRow>
       < / TableLayout>
  < ImageView的...>< / ImageView的>
< / LinearLayout中>
 

解决方案

我把这个在一起真快,试试这个:

 < XML版本=1.0编码=UTF-8&GT?;
< LinearLayout中的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
    机器人:方向=横向
    机器人:layout_width =FILL_PARENT
    机器人:layout_height =FILL_PARENT>
    < ImageView的机器人:layout_width =50dip机器人:layout_height =100dip机器人:后台=#CC0000/>
    < TableLayout机器人:layout_width =WRAP_CONTENT机器人:layout_height =WRAP_CONTENT>
        <的TableRow>
            < ImageView的机器人:layout_width =50dip机器人:layout_height =50dip机器人:后台=#aaaa00/>
            < ImageView的机器人:layout_width =50dip机器人:layout_height =50dip机器人:后台=#00aa00/>
            < ImageView的机器人:layout_width =50dip机器人:layout_height =50dip机器人:后台=#aaaa00/>
        < /的TableRow>
        <的TableRow>
            < ImageView的机器人:layout_width =50dip机器人:layout_height =50dip机器人:后台=#00aa00/>
            < ImageView的机器人:layout_width =50dip机器人:layout_height =50dip机器人:后台=#aaaa00/>
            < ImageView的机器人:layout_width =50dip机器人:layout_height =50dip机器人:后台=#00aa00/>
        < /的TableRow>
    < / TableLayout>
    < ImageView的机器人:layout_width =50dip机器人:layout_height =100dip机器人:后台=#CC0000/>
< / LinearLayout中>
 

I want to build the following layout but it is not working.

<LinearLayout android:orientation="horizontal"...>
  <ImageView ...></ImageView>
        <TableLayout ...>
                        <TableRow..>
                              <ImageView ...></ImageView>
                              <ImageView ...></ImageView>
                              <ImageView ...></ImageView>
                        </TableRow>
                         <TableRow..>
                              <ImageView ...></ImageView>
                              <ImageView ...></ImageView>
                              <ImageView ...></ImageView>
                        </TableRow>
       </TableLayout>
  <ImageView ...></ImageView>
</LinearLayout>

解决方案

I put this together really fast, try this:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent">
    <ImageView android:layout_width="50dip" android:layout_height="100dip" android:background="#cc0000"/>
    <TableLayout android:layout_width="wrap_content" android:layout_height="wrap_content">
        <TableRow>
            <ImageView android:layout_width="50dip" android:layout_height="50dip" android:background="#aaaa00"/>
            <ImageView android:layout_width="50dip" android:layout_height="50dip" android:background="#00aa00"/>
            <ImageView android:layout_width="50dip" android:layout_height="50dip" android:background="#aaaa00"/>
        </TableRow>
        <TableRow>
            <ImageView android:layout_width="50dip" android:layout_height="50dip" android:background="#00aa00"/>
            <ImageView android:layout_width="50dip" android:layout_height="50dip" android:background="#aaaa00"/>
            <ImageView android:layout_width="50dip" android:layout_height="50dip" android:background="#00aa00"/>
        </TableRow>
    </TableLayout>
    <ImageView android:layout_width="50dip" android:layout_height="100dip" android:background="#cc0000"/>
</LinearLayout>

这篇关于Android的表格布局ROWSPAN的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆