Câu hỏi được gắn thẻ «layout-gravity»

5
Android - Chế độ xem văn bản ở giữa theo chiều ngang trong LinearLayout
Tôi có bố cục cơ bản sau <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/title_bar_background"> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:textAppearance="?android:attr/textAppearanceLarge" android:padding="10dp" android:text="HELLO WORLD" /> </LinearLayout> <LinearLayout> Có vẻ như xml là đúng nhưng văn bản được căn chỉnh ở bên trái. Chế độ xem văn bản chiếm toàn …
Khi sử dụng trang web của chúng tôi, bạn xác nhận rằng bạn đã đọc và hiểu Chính sách cookie và Chính sách bảo mật của chúng tôi.
Licensed under cc by-sa 3.0 with attribution required.