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

Android 將 android view 的位置設(shè)為右下角的解決方法

 更新時(shí)間:2013年05月28日 10:21:37   作者:  
Android 將 android view 的位置設(shè)為右下角的解決方法,需要的朋友可以參考一下

在做android開(kāi)發(fā)時(shí)有這樣一個(gè)需求,我們需要把地圖的zoomcontroller放置于地圖的右下角。
  默認(rèn)情況下,我們?cè)趀clipse中拖動(dòng)控件到editor中,控件的位置將位于整個(gè)屏幕的左上角??梢允褂?android:layout_gravity、android:gravity和android:width三個(gè)屬性值,實(shí)現(xiàn)控件的九宮格定位。

  Xml代碼

復(fù)制代碼 代碼如下:

   < ZoomControls android:id="@+id/zoomcontroller"

   android:layout_gravity="bottom" android:gravity="right"

   android:layout_width="fill_parent" android:layout_height="wrap_content" >< /ZoomControls >

  < ZoomControls android:id="@+id/zoomcontroller"

  android:layout_gravity="bottom" android:gravity="right"

  android:layout_width="fill_parent" android:layout_height="wrap_content" >< /ZoomControls >


  以上代碼實(shí)現(xiàn)了將控件置于右下角。那么如何將控件置于下方中間呢?只需要將android:gravity的值改為center即可。

相關(guān)文章

最新評(píng)論