首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 操作系统 >

Android ApiDemos示范解析(148):Views->Layouts->LinearLayout->8. Gravity

2012-09-25 
Android ApiDemos示例解析(148):Views-Layouts-LinearLayout-8. Gravity本例将一个普通的LinearLayout

Android ApiDemos示例解析(148):Views->Layouts->LinearLayout->8. Gravity

本例将一个普通的LinearLayout做为子View放在FrameLayout中,并使用Padding 调整位置。

<FrameLayout xmlns: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示范解析(148):Views->Layouts->LinearLayout->8. Gravity

 

热点排行