Android学习笔记: 第三天
来源:互联网 发布:网络暴力 电影 2011 编辑:程序博客网 时间:2024/06/05 10:07
6. 常用控件
EditText
TextView
Button
Menu
7. 8. Activity生命周期
onCreate
onStart
onresume
onPause
onStop
onRestart
onDestory
Task
9. Activity布局(一) LinearLayou 和 TableLayout
LinearLayout
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="fill_parent" android:orientation="vertical" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /> <TextView android:id="@+id/firstText" android:text="第一行" android:gravity="center_vertical" android:textSize="35pt" android:background="#aa0000" android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingLeft="10dip" android:paddingTop="20dip" android:paddingRight="30dip" android:paddingBottom="40dip" android:layout_weight="1" android:singleLine="true"/> <TextView android:id="@+id/secondText" android:text="第二行" android:gravity="center_vertical" android:textSize="15pt" android:background="#0000aa" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1"/></LinearLayout>
TableLayout
<?xml version="1.0" encoding="utf-8"?><TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:stretchColumns="0"> <TableRow> <TextView android:text="@string/row1_column1" android:background="#aa0000" android:padding="3dip" /> <TextView android:text="@string/row1_column2" android:padding="3dip" android:gravity="center_vertical" android:background="#00aa00" /> <TextView android:text="@string/row1_column3" android:gravity="right" android:background="#0000aa" android:padding="3dip" /> </TableRow> <TableRow> <TextView android:text="@string/row2_column1" android:padding="3dip" /> <TextView android:text="@string/row2_column2" android:gravity="right" android:padding="3dip" /> </TableRow></TableLayout>
10. Activity布局(二) LinearLayou 和 TableLayout 的嵌套
11. Activity布局(三)相对布局
<?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="wrap_content" android:padding="10px" > <TextView android:id="@+id/label" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Type here:" /> <EditText android:id="@+id/entry" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@android:drawable/editbox_background" android:layout_below="@id/label" /> <Button android:id="@+id/ok" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/entry" android:layout_alignParentRight="true" android:layout_marginLeft="10px" android:text="OK" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toLeftOf="@id/ok" android:layout_alignTop="@id/ok" android:text="Cancel" />t</RelativeLayout>
- Android学习笔记: 第三天
- 第三天学习笔记
- 第三天学习笔记
- 学习笔记第三天
- Css 学习笔记第三天
- Struts学习笔记第三天
- java学习笔记--第三天
- liunx学习第三天笔记
- Java学习第三天笔记
- JSP学习笔记(第三天)
- processing第三天学习笔记
- JAVA学习第三天笔记
- JAVASE学习笔记第三天
- 第三天学习笔记2
- 第三天java学习笔记
- HTML第三天学习笔记
- hibernate学习第三天笔记
- Android自学笔记 第三天
- How to write to TO CHAR and TO DATE SQL SERVER
- C++ socket实现获取本机IP&MAC
- Java的Properties文件操作类
- android-drawable大小
- js switch case default 的用法
- Android学习笔记: 第三天
- Oracle中的Translate与Replace
- 为什么Windows Phone 7不支持C++?
- 写javascript代码的技巧
- 获取sqlserver数据库中所有库、表、字段名的方法
- jquery 操作外部iframe
- row_number()over函数的使用.doc
- URL重写的几种实现方式的总结
- 从腾讯QQ升级游戏之“快速加入游戏”功能的实现缺陷看C/S之间如何正确分配相关协作