Trong màn hình ứng dụng của tôi, tôi muốn hiển thị Tiêu đề là trung tâm theo chiều ngang. Tôi đã thử với mã xml dưới đây bố tríTrung tâm văn bản nằm ngang trong RelativeLayout
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginTop="10dip"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="Connections" />
</RelativeLayout>
nhờ
xem http://stackoverflow.com/questions/8767655/application-name-center-alignment-in-android/8767692#8767692 – NagarjunaReddy
Xml version = "1.0" encoding = "utf-8"?> < RelativeLayout xmlns: android = "http://schemas.android.com/apk/res/android" android: layout_width = "fill_parent" android: layout_height = "fill_parent" android: layout_marginTop = "10dip" > RelativeLayout> –
Android