Layout---Linear Layout和Relative Layout
来源:互联网 发布:u盘编程raw 编辑:程序博客网 时间:2024/04/27 07:18
Linear Layout和Relative Layout
1、Linear Layout
例子代码如下截图 :
更多关于Linear Layout参数设置见如下链接:
http://developer.android.com/reference/android/widget/LinearLayout.LayoutParams.html
2、Relative Layout
例子代码截图如下:
更多关于Linear Layout参数设置见如下链接:
http://developer.android.com/reference/android/widget/RelativeLayout.LayoutParams.html
有需要两例子代码的 如下:
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingLeft="16dp" android:paddingRight="16dp" android:orientation="vertical" > <EditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="@string/to" /> <EditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="@string/subject" /> <EditText android:layout_width="fill_parent" android:layout_height="0dp" android:layout_weight="1" android:gravity="top" android:hint="@string/message" /> <Button android:layout_width="100dp" android:layout_height="wrap_content" android:layout_gravity="right" android:text="@string/send" /></LinearLayout>
<?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" android:paddingLeft="16dp" android:paddingRight="16dp" > <EditText android:id="@+id/name" android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="@string/reminder" /> <Spinner android:id="@+id/dates" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_below="@id/name" android:layout_alignParentLeft="true" android:layout_toLeftOf="@+id/times" /> <Spinner android:id="@id/times" android:layout_width="96dp" android:layout_height="wrap_content" android:layout_below="@id/name" android:layout_alignParentRight="true" /> <Button android:layout_width="96dp" android:layout_height="wrap_content" android:layout_below="@id/times" android:layout_alignParentRight="true" android:text="@string/done" /></RelativeLayout>
0 0
- Layout---Linear Layout和Relative Layout
- Linear Layout,Relative Layout
- Layout--Linear与Relative
- Relative Layout
- Relative Layout
- 布局(线性布局 Linear Layout )相对布局 (Relative Layout)
- Linear Layout
- Linear Layout
- Linear Layout
- Layout
- Layout
- layout
- layout
- layout
- layout
- Layout
- layout
- layout
- IE中关于innerHTML的问题
- Linux系统Load average负载详细解释
- 2014日内瓦车展:宝马新款X3正式发布
- 据全俄社会舆论研究中心3月20日发布的民调数据显示
- Lua5.1编程四:Lua与C交互基础
- Layout---Linear Layout和Relative Layout
- HDU 3555 Bomb 简单数位DP
- 更新yum库
- 如何实现团队的自组织管理
- 查找某个路径下的大文件并删除
- iOS真机测试,为Provisioning添加设备
- equals(Object obj)和 hashcode()方法
- SAP的四代增强简介
- 【BZOJ】【水题合集】【P1271】【P1800】【P2150】【P1015】【#6】