当前位置:编程学习 > wap >>

Android初学开发者,布局问题。很纠结。

我刚开发android两天,布局问题很让我困扰,因为它不像HTML一样,直接控制位置就可以,也不像图形界面开发拖拽就可以
这么多布局方式,不知道大家最长用的是什么,有什么布局技巧没。
我写了一个列表,布局怎么也搞不定,
code

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout  xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#C8D0D4"
    >
     <ImageView android:background="@drawable/title" android:layout_width="320px" android:layout_height="40px" />
    <LinearLayout 
    android:layout_width="300px" 
    android:layout_height="100px" 
    android:background="@drawable/menu_border"
    android:orientation="horizontal"
    android:layout_marginLeft="10px"
    android:layout_marginRight="10px"
    android:layout_marginTop="10px"
    >
    <ImageView android:background="@drawable/index_01" android:layout_width="wrap_content" android:layout_marginLeft="5px" android:layout_marginTop="5px"
    android:layout_height="85px"
    />
    <TableLayout android:layout_height="90px" android:layout_width="wrap_content">
     <TableRow>
     <TextView android:textSize="20px" android:layout_height="match_parent" android:layout_marginLeft="20px" android:layout_marginTop="10px" android:text="希尔顿大酒店"  android:layout_width="150px" android:textColor="#000000"/>
     </TableRow>
     <TableRow>
     <ImageButton android:layout_width="50px" android:src="@drawable/holiday" android:layout_height="wrap_content"></ImageButton>
     </TableRow>
    </TableLayout>
    </LinearLayout>
</LinearLayout>

我控制不了ImageButton的大小, 我虽然写的是50px但是它始终是第一个tablerow一样的宽度150px,请问大家,我该怎么解决
[img=http://b97.photo.store.qq.com/psb?/V14B3lYJ4EFWRM/YQ*BkO0gpooES6d29XI*lAU2gLdIPS3SYzxd.T6mgX4!/b/YWos1zlzWQAAYhoi1zk9WgAA][/img]
这个是效果图[img=http://b102.photo.store.qq.com/psb?/V14B3lYJ4EFWRM/.Q4qzqdlF6E7jjcbvxVreM0s1vt6z1nTAmMNo*8NntI!/b/Ya8s2Dy*CgAAYqXC2TyRCgAA][/img] --------------------编程问答-------------------- 图片看不到呀 --------------------编程问答-------------------- 图片都没看到,重新上传一下吧
补充:移动开发 ,  Android
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,