Android 台灣中文網

標題: 如何使設置的imageview對齊框界 [打印本頁]

作者: kansas73    時間: 2014-2-13 17:15
標題: 如何使設置的imageview對齊框界
大家好,最近在學習設計UI
我設置一張imageview,但是我發現他與上方狀態列(就是電量、訊號強度、時間那一列)
之間還有一條空格無法緊密起來
就連我下方另設置的ImageSwitcher與上方這張中間也是有空隙無法緊密
以下是我的XML,希望大家可以提點一下,或者可以跟我講關鍵字就好我會自己GOOGLE學習謝謝!!
  1. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  2.     xmlns:tools="http://schemas.android.com/tools"
  3.     android:layout_width="match_parent"
  4.     android:layout_height="match_parent">
  5.     <ImageView
  6.         android:id="@+id/imageView1"
  7.         android:layout_width="wrap_content"
  8.         android:layout_height="wrap_content"
  9.         android:layout_alignParentTop="true"
  10.         android:src="@drawable/titlebar" />
  11.     <ImageSwitcher
  12.         android:id="@+id/switcher"
  13.         android:layout_width="wrap_content"
  14.         android:layout_height="wrap_content"
  15.         android:layout_below="@+id/imageView1"/>
  16. </RelativeLayout>
複製代碼

作者: CarolHsieh    時間: 2014-4-23 16:59
可以用LinearLayout把兩個物件包起來
並給兩個物件設定
android:layout_weight="1"





歡迎光臨 Android 台灣中文網 (https://apk.tw/) Powered by Discuz! X3.1