项目中因为一些特殊要求,需要使用RelativeLayout 布局。在这里稍作整理。 1.居中 在RelativeLayout的子空间里,使用以下3个属性就行了。 android:layout_centerVertical="true" android:layout_centerHorizontal="true" android:layout_centerInParent="true"