1

我有两个图像视图,它们是两个面对面的足球头盔。我想将它们居中,然后将它们向左/向右偏移一点,以在它们之间提供一点空间。这是目前图像视图的 xml 之一。

<ImageView
   android:id="@+id/hometeam"
   android:scaleType="centerInside"
   android:layout_width="fill_parent"
   android:layout_height="70px"
   android:layout_y="90px"
   android:layout_marginLeft="25px">

我试图使用 [android:layout_marginLeft="25px"] 来抵消它,但是我猜这对我不起作用,因为 [android:scaleType="centerInside"]。有人知道解决方案吗?谢谢!

4

1 回答 1

1

为布局设置android:gravity="center"

于 2010-07-16T20:15:50.467 回答