我试图让两个 ImageView 并排放置,并在图像周围留出空隙。我一直在使用 Padding、Margin 等并且都具有相同的效果(见下图)
如您所见,右侧的图像向上移动,我该如何阻止它?
这是我使用的布局文件:
<?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" >
<!-- Top Row -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/tab_headlines"
android:src="@drawable/headlines"
android:layout_margin="5sp"
/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/tab_headlines"
android:src="@drawable/headlines"
/>
</LinearLayout>
我将使用更多的图像行,因此额外的 LinearLayout