我試圖找到一種方式來佈局Android的佈局如下:如何在Android的一個複雜的Layout佈局
凡爲(4)爲背景色,這應該是居中在屏幕的底部並且正好是屏幕的1/3寬度。 (1),(2),(3)是圖像,其中(1)和(2)應該位於(4)內部的中心,並且(3)應該位於(4)的右上角的中心。
沒有什麼工作對我來說:(
如何使用Android的佈局。這一個
編輯:
我成功地創建(1)+(2)+(4),但。沒有運氣(3)這裏是我的代碼:
<LinearLayout
android:id="@+id/layout4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="50dp"
android:gravity="center"
android:weightSum="1.0" >
<LinearLayout
android:id="@+id/layoutSaveShare_inner"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_weight="0.33"
android:background="@color/light_blue"
android:gravity="center"
android:orientation="horizontal"
android:weightSum="1.0" >
<ImageView
android:id="@+id/img1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.43"
android:src="@drawable/btn1" />
<ImageView
android:id="@+id/img2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.43"
android:src="@drawable/btn2" />
</LinearLayout>
</LinearLayout>
感謝
您不能在xml佈局中將視圖放置在3的中心周圍。 – Luksprog 2013-05-07 14:45:52
我不需要那個。 (4)在屏幕中居中,(3)應按照(4)放置 - 在其右上角 – Roman 2013-05-07 14:53:55
從您的圖像看起來像4的右上角正好在3的中心。您不要不想要這個? – Luksprog 2013-05-07 14:56:57