Android之UI编程(一):线性布局
2015-05-13 22:26
316 查看
package com.example.fk_layout; import android.app.Activity; import android.os.Bundle; public class LinearLayout extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.linear_layout); } }
linear_layout.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" android:gravity="top|center_horizontal"> <Button android:id="@+id/btn1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/btn1" /> <Button android:id="@+id/btn2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/btn2" /> <Button android:id="@+id/btn3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/btn3" /> <Button android:id="@+id/btn4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/btn4" /> </LinearLayout>
string.xml
<?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">fk_layout</string> <string name="hello_world">Hello world!</string> <string name="btn1">测试按钮1</string> <string name="btn2">测试按钮2</string> <string name="btn3">测试按钮3</string> <string name="btn4">测试按钮4</string> </resources>
相关文章推荐
- Android -- UI布局管理,相对布局,线性布局,表格布局,绝对布局,帧布局
- Android -- UI布局管理,相对布局,线性布局,表格布局,绝对布局,帧布局
- Android UI控件系列:LinearLayout(线性布局)
- Android UI基本测验:线性布局
- Android UI之LinearLayout(线性布局)
- Android之UI编程(二):表格布局
- Android UI基本测验“.NET研究”:线性布局
- android ui 布局<线性布局中的剩余空间使用>
- Android UI基本测验:线性布局
- Android UI 开发入门—线性布局练习
- Android中LinearLayout线性布局
- Android用户界面设计:线性布局
- 第二章 UI开发——Android 布局类型
- android Activity线性布局和表格布局实例讲解
- Android基础_2 Activity线性布局和表格布局
- Android UI布局之LinearLayout
- android-----UI布局之TabHost与TextView
- Android学习(十一)五布局之线性布局
- Android常用布局(FrameLayout(框架布局)、LinearLayout(线性布局)、RelativeLayout(相对布局))详解
- android布局之线性布局