Dear folks,
I am not able to work with the scrolls which I have added in my XML file called choice.xml. This XML file has a set of radio buttons and an exit button. I have written the following code for choice.xml file:
choice.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="700dip" android:orientation="vertical" android:id="@+id/linearLayout">
<TextView android:layout_width="wrap_content" android:textSize="15sp" android:id="@+id/textView1" android:layout_height="wrap_content" android:text="@string/strChoice"></TextView>
<ScrollView android:id="@+id/scrollView1" android:layout_height="600dip" android:layout_width="fill_parent">
<RadioGroup android:id="@+id/radioGroup1" android:layout_width="wrap_content" android:layout_height="wrap_content">
<RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/optFiveLetterWord" android:text="@string/strFiveLetterWord"></RadioButton>
<RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/optSixLetterWord" android:text="@string/strSixLetterWord"></RadioButton>
<RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/optSevenLetterWord" android:text="@string/strSevenLetterWord"></RadioButton>
<RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/optEightLetterWord" android:text="@string/strEightLetterWord"></RadioButton>
<RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/optNineLetterWord" android:text="@string/strNineLetterWord"></RadioButton>
<RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/optTenLetterWord" android:text="@string/strTenLetterWord"></RadioButton>
<RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/optTwelveLetterWord" android:text="@string/strTwelveLetterWord"></RadioButton>
</RadioGroup>
</ScrollView>
<RelativeLayout android:layout_marginTop="-50dip" android:gravity="bottom" android:layout_height="wrap_content" android:layout_width="fill_parent">
<Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/btnExit" android:text="@string/strExit"></Button>
</RelativeLayout>
</LinearLayout>
I have not written any code in Choice.java which is an Activity class and corresponds to choice.xml. When I
test the application after installing in the android phone, the scroll is not working. It does not work for portrait as well as the landscape orientation.
I know that I have to write the code in Choice.java but don't know what to write and how to use the ScrollView. Please help.