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