欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Android編程布局(Layout)之AbsoluteLayout用法實(shí)例分析

 更新時(shí)間:2015年12月22日 15:29:14   作者:2cto  
這篇文章主要介紹了Android編程布局(Layout)之AbsoluteLayout用法,結(jié)合實(shí)例形式簡(jiǎn)單分析了Android絕對(duì)布局AbsoluteLayout的實(shí)現(xiàn)方法,需要的朋友可以參考下

本文實(shí)例講述了Android編程布局(Layout)之AbsoluteLayout用法。分享給大家供大家參考,具體如下:

AbsoluteLayout,顧名思義,就是絕對(duì)位置的布局;也可以叫做坐標(biāo)布局,也就是指定元素的絕對(duì)位置(或者叫絕對(duì)坐標(biāo)值)。這種布局簡(jiǎn)單直接,直觀性強(qiáng),但是由于手機(jī)屏幕尺寸差別比較大,使用絕對(duì)定位的適應(yīng)性會(huì)比較差。

<?xml version = "1.0" encoding = "utf-8"?>
<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="fill_parent"
 android:layout_height="wrap_content"
 android:padding="10dip">
 <TextView android:id="@+id/lable"
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   android:text="請(qǐng)輸入用戶名:"/>
 <EditText android:id="@+id/text"
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   android:layout_x="100dip"
   android:layout_y="20dip"/>
 <Button android:id="@+id/cancel"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:layout_x="10dip"
   android:layout_y="50dip"
   android:text="取消"/>
 <Button android:id="@+id/ok"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:layout_x="60dip"
   android:layout_y="50dip"
   android:text="確定"/>
</AbsoluteLayout>

效果如下:

如果不指定Layout_x 和Layout_y 那么默認(rèn)都為0.回顯示在最左上角。

希望本文所述對(duì)大家Android程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論