Android编程布局控件之AbsoluteLayout用法实例分析
更新时间:2015年12月22日 14:53:47 作者:admin
这篇文章主要介绍了Android编程布局控件之AbsoluteLayout用法,结合实例形式简单分析了Android绝对布局AbsoluteLayout的使用技巧,需要的朋友可以参考下
本文实例讲述了Android编程布局控件之AbsoluteLayout用法。分享给大家供大家参考,具体如下:
AbsoluteLayout是绝对布局管理器,指的是指定组件的左上角绝对坐标来指定组件的布局
<?xml version="1.0" encoding="utf-8"?> <AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="按钮1" android:layout_x="0px" android:layout_y="0px" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="按钮2" android:layout_x="20px" android:layout_y="20px" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="按钮3" android:layout_x="40px" android:layout_y="40px" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="按钮4" android:layout_x="60px" android:layout_y="60px" /> </AbsoluteLayout>
运行效果截图如下:
希望本文所述对大家Android程序设计有所帮助。
相关文章
Android中ActionBar和ToolBar添加返回箭头的实例代码
这篇文章主要介绍了Android中ActionBar和ToolBar添加返回箭头的实例代码,需要的朋友可以参考下2017-09-09android WindowManager的简单使用实例详解
这篇文章主要介绍了android WindowManager的简单使用,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下2023-08-08
最新评论