0

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 ?

2
  • 2
    You've edited the question to include the suggested answers - this is now confusing. You should mention in the edit that you have done that, or anyone else viewing this question later may not understand what the problem & related solution is. StackOverflow isn't just for getting your questions answered, its for building a repository of Q&A to help developers. Commented Jul 1, 2010 at 10:39
  • it's the same question i just added more text and example in order to help others see the all picture annd i might be wrong in another place ... Commented Jul 1, 2010 at 10:53

3 Answers 3

2

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> 
Sign up to request clarification or add additional context in comments.

1 Comment

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 ?...
0

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

Comments

0

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

2 Comments

Sorry for double posting. I see now that ccheneson responded a bit faster.
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?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.