0
我有一个正确居中的TextView,但是当我想居中表格的内容时,如果没有对齐到居中。我试图将TableLayout的内容与中心对齐
layout_gravity="center"
和
gravity="center"
两者都不能正常工作。我能做什么?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="@+id/date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="20dp" />
<TableLayout
android:id="@+id/table"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/date" />
</RelativeLayout>
你在'TableLayout'本身或表中的元素上试过了吗? – Szymon
TableLayout本身。我编程创建TableRows – Nfear
尝试将它们居中。 – Szymon