xml文件
1.开头
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
</RelativeLayout>
2.属性
/*id、宽、高、图片资源位置*/
android:id="@+id/surfaceView" //通过R.id..调用
android:layout_width="200px"
android:layout_height="160px"
android:src="@drawable/ic_launcher"
android:text="@string/hello_world" //string里设置hello_world的值
3.线型布局设置
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="horizontal" >
控件
</LinearLayout>
更多相关文章
- VideoView控件
- android 控件的移动
- android控件-ImageView使用方法整理
- Android 控件背景图片和imagebutton的使用(selector)
- Android自带的时间空间和日期控件
- Android 界面开发---控件事件监听器、按键处理
- 我的android 第5天 - 常见控件使用
- ProgressBar控件的使用(Android设置条形,环形进度条)