1、让TextView里的内容水平居中

 android:gravity="center_horizontal"

2、让TextView控件在它的父布局里水平居中

 android:layout_gravity="center_horizontal"

 3、文本布局示例

   <EditText 
        android:id="@+id/factorOne"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"/>
    <EditText 
        android:id="@+id/factorTwo"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/sym"/>
    <TextView
        android:id="@+id/sym"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/factorOne"/>        
    <Button 
        android:id="@+id/cal"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/factorTwo"/>

Copyright © 吴华锦
雅致寓于高阁渔舟唱晚,古典悠然
格调外发园林绿树萦绕,馥郁清香

相关文章:

  • 2021-05-29
  • 2022-12-23
  • 2021-07-05
  • 2021-09-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-22
  • 2022-12-23
  • 2021-11-21
  • 2022-12-23
相关资源
相似解决方案