0
我試圖將ScrollView添加到包含各種TextView,ImageView和ListView的佈局中。爲什麼我想要能夠滾動的原因是因爲所有的文本和圖像佔用了幾乎所有的空間,併爲ListView留下了很少的空間。如何爲包含文本,圖像和ListView的佈局實現ScrollView
我不知道如何實施這個艱難。 繼承人我的XML佈局的代碼。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:orientation="vertical" >
<ImageView
android:id="@+id/pubInfoImg"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/pubInfoWelcome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingLeft="10dp" />
<TextView
android:id="@+id/pubInfoTapsNo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="5"
android:padding="10dp" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="0.7dip"
android:layout_centerVertical="true"
android:background="@android:color/holo_blue_dark" />
<TextView
android:id="@+id/pubInfoAddress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp" />
<TextView
android:id="@+id/pubInfoUrl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp" />
<TextView
android:id="@+id/pubInfoOpenhours"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp" />
<ListView
android:id="@+id/tapsListview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#BABABA"
android:divider="@android:color/transparent"
android:dividerHeight="0.0sp"
android:footerDividersEnabled="true"
android:headerDividersEnabled="true" />
</LinearLayout>
中將listview視圖添加到android中 – user1258829 2013-05-06 11:23:47