我不知道爲什麼它不會滾動。我只有一個線性佈局和TextViews以及一些RadioButton,並且我已經將它封裝在滾動視圖中。 所以我有六個textview和五個RadioGroups裏面我有3個單選按鈕。 我嘗試了一切,請指教。 在此先感謝。Android ScrollView
<ScrollView
android:layout_height="match_parent"
android:layout_width="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.android.quizcapitals.MainActivity">
<TextView
style="@style/Header_Text_Style"
android:text="@string/test_knowledge" />
<TextView
style="@style/Header_Text_Style"
android:text="@string/usa" />
<RadioGroup xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/Radio_Groups">
<RadioButton
android:id="@+id/newyork"
style="@style/Radio_Buttons"
android:onClick="onRadioButtonClicked"
android:text="@string/newyork" />
<RadioButton
android:id="@+id/washington"
style="@style/Radio_Buttons"
android:onClick="onRadioButtonClicked"
android:text="@string/Washington" />
<RadioButton
android:id="@+id/chicago"
style="@style/Radio_Buttons"
android:text="@string/chicago" />
</RadioGroup>
<TextView
style="@style/Header_Text_Style"
android:text="@string/germany" />
<RadioGroup xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/Radio_Groups">
<RadioButton
android:id="@+id/frankfurt"
style="@style/Radio_Buttons"
android:onClick="onRadioButtonClicked"
android:text="@string/frankfurt" />
<RadioButton
android:id="@+id/berlin"
style="@style/Radio_Buttons"
android:onClick="onRadioButtonClicked"
android:text="@string/berlin" />
<RadioButton
android:id="@+id/munich"
style="@style/Radio_Buttons"
android:text="@string/munich" />
</RadioGroup>
<TextView
style="@style/Header_Text_Style"
android:text="@string/france" />
<RadioGroup xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/Radio_Groups">
<RadioButton
android:id="@+id/paris"
style="@style/Radio_Buttons"
android:onClick="onRadioButtonClicked"
android:text="@string/paris" />
<RadioButton
android:id="@+id/nice"
style="@style/Radio_Buttons"
android:onClick="onRadioButtonClicked"
android:text="@string/nice" />
<RadioButton
android:id="@+id/marseille"
style="@style/Radio_Buttons"
android:text="@string/marseille" />
</RadioGroup>
<TextView
style="@style/Header_Text_Style"
android:text="@string/italy" />
<RadioGroup xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/Radio_Groups">
<RadioButton
android:id="@+id/venice"
style="@style/Radio_Buttons"
android:onClick="onRadioButtonClicked"
android:text="@string/venice" />
<RadioButton
android:id="@+id/florence"
style="@style/Radio_Buttons"
android:onClick="onRadioButtonClicked"
android:text="@string/florence" />
<RadioButton
android:id="@+id/rome"
style="@style/Radio_Buttons"
android:text="@string/rome" />
</RadioGroup>
<TextView
style="@style/Header_Text_Style"
android:text="@string/canada" />
<RadioGroup xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/Radio_Groups">
<RadioButton
android:id="@+id/toronto"
style="@style/Radio_Buttons"
android:onClick="onRadioButtonClicked"
android:text="@string/toronto" />
<RadioButton
android:id="@+id/ottawa"
style="@style/Radio_Buttons"
android:onClick="onRadioButtonClicked"
android:text="@string/ottawa" />
<RadioButton
android:id="@+id/montreal"
style="@style/Radio_Buttons"
android:text="@string/montreal" />
</RadioGroup>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="finish"
android:text="Finish"
android:textAllCaps="true" />
</LinearLayout>
</ScrollView>