您的位置:首页 > 移动开发 > Android开发

android简单demo学习系例之排版(TableLayout)[xml-based]

2009-02-06 21:18 671 查看
在eclipse下利用android开发插件,来写基于xml-based的图形界面很简单也很方便.

 



 

在outline或效果界面中选中所编辑的节点(View),接着在下边 的Property窗口下其对应的属性列表中填写自定义的属性值.

 

结果出来的Layout文件如下(可以查看如下文件来填写节点属性值-在上面的步骤)

 

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TableLayout android:id="@+id/sTableLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TableRow >
<ImageView android:background="@drawable/bg1"/>
<EditText/>
</TableRow>
<TableRow>
<ImageView android:background="@drawable/bg2"/>
<EditText/>
</TableRow>
</TableLayout>
<Button android:id="@+id/exitButton"
android:text="退出"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/sTableLayout"
android:layout_marginTop="20sp"/>
</RelativeLayout>


 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息