Android ScrollView没有';不显示整个桌面布局
我想在Android ScrollView没有';不显示整个桌面布局,android,android-layout,android-scrollview,android-tablelayout,Android,Android Layout,Android Scrollview,Android Tablelayout,我想在滚动视图中显示表格布局。该表有9个TableRows,但是ScrollView开始显示第4行的部分内容,我无法滚动查看上面的行 XML布局: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/uyi_choosepi_relativelayout"
滚动视图中显示表格布局
。该表有9个TableRow
s,但是ScrollView
开始显示第4行的部分内容,我无法滚动查看上面的行
XML布局:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/uyi_choosepi_relativelayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:keepScreenOn="true" >
<MyGallery
android:id="@+id/uyi_gallery_originals"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"/>
<TableLayout
android:id="@+id/uyi_choosepi_buttontable"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:stretchColumns="0,1" >
<TableRow >
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hilfe"
android:onClick="showHelp"
android:drawableLeft="@android:drawable/ic_menu_help" />
<Button
android:id="@+id/uyi_choosepi_savepw"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Fertig"
android:clickable="false"
android:enabled="false"
android:onClick="savePassword"
android:drawableLeft="@android:drawable/ic_menu_save"/>
</TableRow>
</TableLayout>
<ScrollView
android:id="@+id/uyi_choosepi_scrollview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@id/uyi_gallery_originals"
android:layout_above="@id/uyi_choosepi_buttontable">
<TableLayout
android:id="@+id/uyi_choosepi_tablelayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_vertical|center_horizontal"
android:layout_gravity="center_vertical"
android:shrinkColumns="0,1,2" />
</ScrollView>
</RelativeLayout>
我希望你能给我一个提示 尝试使用GridView,这可能会让你更接近你的目标。我最近看了[这篇博文][1],我会更倾向于这样做
编辑:我本想粘贴本教程的,对不起,我用线性布局解决了我的问题
<ScrollView
android:id="@+id/uyi_choosepi_scrollview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@id/uyi_gallery_originals"
android:layout_above="@id/uyi_choosepi_buttontable">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TableLayout
android:id="@+id/uyi_choosepi_tablelayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_gravity="center_vertical"
android:shrinkColumns="0,1,2" />
</LinearLayout>
</ScrollView>
尝试更改您的表格布局的布局属性,并在程序中设置CaleType,如果可能,提供指向您的屏幕截图的链接(因为您当前无法发布)
<ScrollView
android:id="@+id/uyi_choosepi_scrollview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@id/uyi_gallery_originals"
android:layout_above="@id/uyi_choosepi_buttontable">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TableLayout
android:id="@+id/uyi_choosepi_tablelayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_gravity="center_vertical"
android:shrinkColumns="0,1,2" />
</LinearLayout>
</ScrollView>