【发布时间】:2012-09-17 22:02:34
【问题描述】:
我需要在 xml 中创建 like this 的内容,但无法使用子 HorizontalScrollView 在 scrollView 中居中内部对象。
这里是代码示例:
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="5"
android:fillViewport="true" >
<HorizontalScrollView
android:id="@+id/horizontalScrollView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableLayout
android:id="@+id/matrix_table"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" >
<!-- auto generated rows -->
</TableLayout>
</RelativeLayout>
</HorizontalScrollView>
</ScrollView>
谢谢!
【问题讨论】:
标签: android xml centering horizontalscrollview