1
我们说下面的图像位于中央。为此,我使用下面的代码。
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="10"
android:orientation="vertical" >
<ImageView
android:src="@drawable/logo"
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RelativeLayout>
它一直在为死亡中心定位。我想做以下事情,并稍微向上偏移它。正如你所看到的,我不想让图像穿过中心线(我知道如何通过添加一个不可见的视图来解决这个问题)。
谢谢你的工作完美。我甚至不需要锚点视图中的“paddingBottom”。 – Mike76