【背景】
此处Android中显示出来的TextView中的内容,水平中间不对其。
想要实现水平居中对齐。
【折腾过程】
1.搜:
android RelativeLayout horizontal center
参考:
试过了:
android:layout_centerHorizontal="true"
但没用。
2.后来看到:
去试了试:
android:layout_centerVertical="true"
才明白:
我上面是错误的搜了horizontal ,实际上该去搜Vertical才对。
现在效果是所需要的了:
【总结】
想要水平居中对齐,则只需要去设置:
android:layout_centerVertical="true"
即可。
【引申】
更多的其他参数,可以去官网:
中找到:
Attribute Name
Related Method
Description
Positions the bottom edge of this view ab