android xml布局中TextView文字居中方法
16lz
2021-01-23
XML文件内容如下:<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" ><TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /></LinearLayout> 修改后XML文件内容如下:<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" ><TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" android:gravity="center" /></LinearLayout>
更多相关文章
- android 读写文件
- Android情景模式、文件管理器 完整示例编程详解、Android程序优
- android WebView载入本地html及css文件
- [Android Pro] proguard.cfg 配置文件
- Android 将文件保存到SD卡中
- 编译NotificationManagerService.java文件的方法
- Android studio gradle 无法获取 pom文件
- Android FTP客户端使用,快速上传文件
- Android N共享文件报错:android.os.FileUriExposedException