0
嗨,我有4個圖像並排我試圖增加圖像間距...但itz不工作..tried在Java中setSpacing(int)... android:在xml佈局中的間距Android:Imageviews之間的間距
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="bottom"
android:orientation="horizontal" >
<ImageView
android:id="@+id/navigationImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left"
android:paddingLeft="15dp"
android:spacing="15dp" />
<ImageView
android:id="@+id/streetViewImage"
android:src="@drawable/streetview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left"
android:paddingLeft="15dp"
android:spacing="15dp" />
<ImageView
android:id="@+id/phoneImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left"
android:paddingLeft="20dp"
android:paddingRight="15dp"
android:spacing="15dp" />
</LinearLayout>
這是我的java代碼
ImageView Image = (ImageView) view.findViewById(R.id.navImage);
Image.setImageResource(R.drawable.navigation);
Image.setSpacing(5);
任何幫助表示讚賞
設置左餘量inspite:layout_marginLeft = 「10dp」' – Nishant
@ Nishant..hi與機器人:layout_marginLeft = 「10dp」 我得到僅對第一圖像間距...休息仍然彼此接近 – teekib
也爲所有其他的ImageView添加'android:layout_marginLeft =「10dp」'。 – Nishant