如果在RelativeLayout相对布局中,TextView居中的设置是android:layout_centerInParent="true"。请看清楚,是在相对布局中,TextView居中是这样设置。