在一個活動中,我有一個按鈕和一個列表視圖列表。對於每個類別,我都有一個按鈕,點擊它可以顯示相應的數據。這裏是我的xml代碼。滾動查看問題
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<Button android:layout_width="fill_parent"
android:layout_height="60dp"
android:id="@+id/button_1"
android:text="first"
/>
<Button android:layout_width="fill_parent"
android:layout_height="60dp"
android:id="@+id/button_2"
android:text="second"
/>
<Button android:layout_width="fill_parent"
android:layout_height="60dp"
android:id="@+id/button_3"
android:text="three"
/>
<Button android:layout_width="fill_parent"
android:layout_height="60dp"
android:id="@+id/button_4"
android:text="four"
/>
<Button android:layout_width="fill_parent"
android:layout_height="60dp"
android:id="@+id/button_5"
android:text="five"
/>
<Button android:layout_width="fill_parent"
android:layout_height="60dp"
android:id="@+id/button_6"
android:text="six"
/>
<Button android:layout_width="fill_parent"
android:layout_height="60dp"
android:id="@+id/button_7"
android:text="seven"
/>
<Button android:layout_width="fill_parent"
android:layout_height="60dp"
android:id="@+id/button_8"
android:text="eight"
/>
<ListView android:id="@+id/list" android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="fill_parent"/>
</LinearLayout>
在此活動中,第一個按鈕是可見的。然後點擊按鈕,所有按鈕將不可見,只有列表視圖在那裏。問題是如果我使用滾動視圖,我可以滾動按鈕,但只有一半的列表視圖可以看到意味着我不能滾動它。如果我不使用滾動視圖,我可以滾動列表視圖而不是按鈕。任何人都可以幫助我,我錯了嗎? 謝謝..
謝謝@surisahani – rose
你是最歡迎的@rose ..... :) –