我對Android佈局非常陌生。您能否幫我縮放圖像以覆蓋白色空間的寬度和高度。縮放圖像以填充相對佈局的屏幕
這是屏幕。
其全部傾斜到右側。我怎樣才能使它填滿屏幕
這裏是佈局
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<RelativeLayout
android:id="@+id/jkmenu1"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageButton
android:id="@+id/atm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/airport"
android:layout_alignLeft="@+id/birthday"
android:background="@android:color/transparent"
android:src="@drawable/atm" />
<ImageButton
android:id="@+id/currency"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/birthday"
android:layout_alignTop="@+id/classifieds"
android:src="@drawable/currency"
android:background="@android:color/transparent" />
<ImageButton
android:id="@+id/education"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@+id/coffee"
android:background="@android:color/transparent"
android:src="@drawable/education" />
<ImageButton
android:id="@+id/coffee"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@+id/bar"
android:background="@android:color/transparent"
android:src="@drawable/coffee" />
<ImageButton
android:id="@+id/bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/birthday"
android:layout_alignParentRight="true"
android:background="@android:color/transparent"
android:src="@drawable/bar" />
<ImageButton
android:id="@+id/birthday"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/atm"
android:layout_toLeftOf="@+id/coffee"
android:background="@android:color/transparent"
android:src="@drawable/bithday" />
<ImageButton
android:id="@+id/beauty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/atm"
android:background="@android:color/transparent"
android:src="@drawable/beauty" />
<ImageButton
android:id="@+id/airport"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/beauty"
android:layout_alignLeft="@+id/beauty"
android:background="@android:color/transparent"
android:src="@drawable/airport" />
<ImageButton
android:id="@+id/classifieds"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/beauty"
android:layout_alignTop="@+id/education"
android:background="@android:color/transparent"
android:src="@drawable/classifieds" />
</RelativeLayout>
</LinearLayout>
謝謝大家傢伙
解決方案添加空間
我加
<View android:layout_height="60sp"/>
在代碼上面給了我空間:)把我的其他東西放在屏幕上。
如果u要適應每一個屏幕,你可以使用線性佈局,重量或使用TableLayout – 2013-04-30 12:21:36
能否請你告訴我一些例子@SankarV – Yogus 2013-04-30 12:22:33