此例用于实现产品说明书等相关布局:


布局示意图:


实现代码:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/test_bg1">
<RelativeLayout
android:id="@+id/layout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout android:id="@+id/layout2"
android:layout_width="wrap_content"
android:layout_height="250px"
android:layout_marginTop="20px"
android:layout_marginLeft="20px"
android:layout_marginRight="60px"
>
<ScrollView android:layout_width="wrap_content" android:layout_height="fill_parent" android:id="@+id/scrollView1">
<TextView android:id="@+id/textView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:textColor="#000000"
android:text="sdfsdfasdfasdfsdfasdfasdfasdfasghdfgafgdf,.dfssdkflsdfk;sldfksld;fsdsjdfklsadkfkm"></TextView>
</ScrollView>
</LinearLayout>
<LinearLayout
android:id="@+id/layout3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20px"></LinearLayout>
<Button android:id="@+id/exit"
android:layout_height="65px"
android:layout_width="65px"
android:layout_alignParentRight="true"
android:text="退出"
android:background="@drawable/test_button1"
></Button>
</RelativeLayout>
</LinearLayout>

关键步骤说明:

1.按钮定位到右上角:

android:layout_alignParentRight="true"

更多相关文章

  1. 浅谈Java中Collections.sort对List排序的两种方法
  2. python list.sort()根据多个关键字排序的方法实现
  3. android EditText设置不可写
  4. Android(安卓)拨号器的简单实现
  5. android实现字体闪烁动画的方法
  6. Android中不同应用间实现SharedPreferences数据共享
  7. [Android(安卓)NDK]Android(安卓)JNI开发例子 ---3 在JNI中实现o
  8. android 拨打紧急号码,通话时开启免提功能实现
  9. Android(安卓)组件资源库

随机推荐

  1. 【android】设置View字体点击变色和边框
  2. Android(安卓)Studio导入项目时出现,弹框
  3. Android实现对HOME键的捕获和屏蔽
  4. android中改变标题栏的背景色
  5. (20120808)(01)android菜单与对话框--之日期
  6. Android调用系统应用程序
  7. Android(安卓)Paint Style
  8. 使用ListView应该注意的地方
  9. Android子线程与子线程的通信
  10. Android实现电话状态监控