一直试图解决这个问题。我是Adroid的新手并试图将整个屏幕转到滚动视图......这是一个标题图片和一个列表......希望它能够全部滚动到一起。可以使用这种布局吗?谢谢!
<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/containerView"
android:background="@android:color/transparent"
android:padding="0dip"
android:layout_margin="0dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/headerImageContainer"
android:background="@android:color/transparent"
android:padding="0dip"
android:layout_margin="0dip"
android:layout_centerHorizontal="true"
android:layout_alignParentTop="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/headerImageView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scaleType="center"
android:layout_centerHorizontal="true"
android:layout_alignParentTop="true">
</ImageView>
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/listViewContainer"
android:background="@android:color/transparent"
android:paddingLeft="35dip"
android:paddingRight="35dip"
android:paddingTop="10dip"
android:paddingBottom="0dip"
android:layout_margin="0dip"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/headerImageContainer">
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/listView"
android:background="@android:color/transparent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:cacheColorHint="#000000"
android:choiceMode="singleChoice"
android:layout_weight="1"
android:scrollbars="none">
</ListView>
</LinearLayout>
</RelativeLayout>
答案 0 :(得分:0)
答案 1 :(得分:0)
封装
中的所有内容<LinearLayout
...>
<ScrollView
...>
Your original XML content here
</ScrollView>
</LinearLayout>
它应该有用。