tags:

views:

98

answers:

3

scrollable meaning by the user touch he can can go up and down in the layout given

this is what i did and the emulator throw an exception null pointer somthing and i have problems figuring out from where it comes ....

<?xml version="1.0" encoding="UTF-8"?>
<ScrollView>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="1">


<LinearLayout

 android:layout_width="wrap_content" 
 android:layout_height="wrap_content">
 <TextView 
 android:text="Country City Game(aka CCG) is an acdemic work of MTA students enjoy the game"
  android:textSize="24.5sp"
 android:layout_width="fill_parent"
 android:layout_height="fill_parent"></TextView>
 </LinearLayout>




</TableLayout>
</ScrollView>

this one doesnt work but when i drop

   <ScrollView> </ScrollView> 

it works can some one explain to me what's wrong ?

A: 

Surround the layout you want to have a scroll bar attached with a ScrollView

ccheneson
A: 

Put your entire layout that you want to be able to scroll inside a ScrollView.

kaciula
Sorry for double posting. I see now that ccheneson responded a bit faster.
kaciula
please notice the changes up , i thought i am already tried what you were saying but i thought i am not in the right direction might it be something wrong in me getting the concept ? should i do <scrollView> to every View item?
yoav.str
+2  A: 

Try this instead

<?xml version="1.0" encoding="UTF-8"?>

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="fill_parent" android:layout_height="fill_parent">

<TableLayout 
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:stretchColumns="1">

<TableRow>

  <TextView 
   android:text="Country City Game(aka CCG) is an acdemic work of MTA students enjoy the game"
   android:textSize="24.5sp"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"></TextView>

</TableRow>

</TableLayout>

</ScrollView>
James
thank you but still it has a runtime error ... can you see the code above (i just added him) and tell me what's wrong ?...
yoav.str
it's works perectly thank you so much :)
yoav.str