這是我的xml。我想要避免的圖形佈局中的圖像之間存在間隙。我希望所有圖像都以這樣一種方式彼此對齊,以使5幅圖像看起來像一幅圖像。如何使用ImageViews將五個圖像相互連接在一起?
<LinearLayout
android:id="@+id/linearInteractTab"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:weightSum="5"
android:layout_margin="5dp" >
<ImageView
android:id="@+id/imgCall"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:src="@drawable/call" />
<ImageView
android:id="@+id/imgMsg"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/mail" />
<ImageView
android:id="@+id/imgComment"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/chat" />
<ImageView
android:id="@+id/imgDir"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/direction" />
<ImageView
android:id="@+id/imgAppt"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/calender" />
</LinearLayout>
使用'framelayout'而不是'linearlayout'。這樣圖像就會重疊在一起。 :) – Chaitanya
你試過了,然後給了一個soln? – ParijatDev
是的..它沒有爲我花花公子:)只需將linearlayout替換爲framelayout即可。這爲我做了。只有圖像會重疊。 :) – Chaitanya