android:layout_centerInParent = "true"和 android:layout_gravity = "center"

景才英
2023-12-01
layout_centerVertical="true"

works in a RelativeLayout

while

layout_gravity="center_vertical"

works in a LinearLayout.

 类似资料: