Android ApiDemos示例解析(148):Views->Layouts->LinearLayout->8. Gravity
本例将一个普通的LinearLayout做为子View放在FrameLayout中,并使用Padding 调整位置。
<FrameLayoutxmlns:android=”http://schemas.android.com/apk/res/android”
android:layout_width=”match_parent”
android:layout_height=”match_parent”
android:padding=”30dip”>
<LinearLayout
android:id=”@+id/layout”
android:orientation=”vertical”
android:background=”@drawable/blue”
android:layout_width=”match_parent”
android:layout_height=”match_parent”
android:padding=”30dip”>
<TextView
android:background=”@drawable/box”
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:text=”@string/linear_layout_8_c”/>
<TextView
android:background=”@drawable/box”
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:text=”@string/linear_layout_8_b”/>
<TextView
android:background=”@drawable/box”
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:text=”@string/linear_layout_8_c”/>
</LinearLayout>
</FrameLayout>
更多相关文章
- Android ApiDemos示例解析(138):Views->Layouts->Baseline->6. R
- Android实现的秒表计时器示例
- 利用广播实现ip拨号——示例
- Android百度地图默认位置中心点设置
- Android用属性动画拖动view到任意位置
- android 开发技巧(12)--更改 Toast 显示位置的技巧
- Android中的onCreateOptionsMenu()方法和onOptionsItemSelected()方
- 综合传感器示例
- Android 开发系列6 安装Cordova及示例程序