Android編程布局控件之AbsoluteLayout用法實例分析
更新時間:2015年12月22日 14:53:47 作者:admin
這篇文章主要介紹了Android編程布局控件之AbsoluteLayout用法,結(jié)合實例形式簡單分析了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程序設(shè)計有所幫助。
相關(guān)文章
Android OpenGL ES 實現(xiàn)抖音傳送帶特效(原理解析)
這篇文章主要介紹了Android OpenGL ES 實現(xiàn)抖音傳送帶特效,抖音傳送帶特效推出已經(jīng)很長一段時間了,前面也實現(xiàn)了下,最近把它整理出來了,如果你有仔細觀測傳送帶特效,就會發(fā)現(xiàn)它的實現(xiàn)原理其實很簡單,需要的朋友可以參考下2022-07-07Android啟動內(nèi)置APK和動態(tài)發(fā)送接收自定義廣播實例詳解
這篇文章主要介紹了Android啟動內(nèi)置APK和動態(tài)發(fā)送接收自定義廣播實例詳解的相關(guān)資料,需要的朋友可以參考下2017-06-06