android UI 布局

Chaos
  • 152

clipboard.png

clipboard.png

上边的TextView是设置的水平居中,但是显示还是在左上角,怎么让它局中显示?

回复
阅读 2.1k
3 个回答
修改以下两个属性:
<TextView
 android:layout_width="match_parent"
 android:gravity="center_horizontal" />

clean一下,重新编译,运行一下

you should set orientation for LinearLayout,if you want to make TextView center horizontal,just setandroid:orientation="vertical" for LinearLayout is OK ~

宣传栏