如果设置一个Button的android:gravity="center" android:text="按钮",则是设置了“按钮”两个字在Button中居中显示,要想设置Button在父控件中水平居中,应该用
android:layout_centerHorizontal="true"