本例将一个普通的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示例解析(148):Views->Layouts->LinearLayout->8. Gravity_第1张图片

更多相关文章

  1. Android ApiDemos示例解析(138):Views->Layouts->Baseline->6. R
  2. Android实现的秒表计时器示例
  3. 利用广播实现ip拨号——示例
  4. Android百度地图默认位置中心点设置
  5. Android用属性动画拖动view到任意位置
  6. android 开发技巧(12)--更改 Toast 显示位置的技巧
  7. Android中的onCreateOptionsMenu()方法和onOptionsItemSelected()方
  8. 综合传感器示例
  9. Android 开发系列6 安装Cordova及示例程序

随机推荐

  1. spring-android的使用
  2. 安卓相对布局
  3. Android(安卓)SDK Tools Platform-tools
  4. 2010.10.28———Android(安卓)02
  5. Android(安卓)的一些比较好的开源代码项
  6. EditText的一些使用注意点
  7. [Android]Android(安卓)manifest 属性说
  8. Android百度地图相关内容汇总
  9. 【Android】FadingEdge
  10. Android(安卓)NDK应用开发