2010-07-01 18 views
0

滾動的含義由用戶觸摸他可以向下給出這聽起來像一個微不足道的問題,但誰使我的佈局滾動

此佈局上去,是我做過什麼和仿真器拋出一個異常空指針財產以後和我有它是從哪裏來的搞清楚問題....

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

這一個不工作,但是當我放棄

<ScrollView> </ScrollView> 

它的作品可以給我一些解釋一個什麼WRO ng?

+2

你編輯的問題,包括建議的答案 - 這是現在混亂。你應該在編輯中提到你已經完成了這項工作,否則任何其他人以後查看此問題可能無法理解問題和相關解決方案。 StackOverflow不僅僅是爲了解答你的問題,而是爲了幫助開發者建立一個問答庫。 – cjk 2010-07-01 10:39:38

+0

這是同樣的問題,我只是添加更多的文字和示例,以幫助其他人看到所有圖片和我可能在另一個地方是錯誤的... – 2010-07-01 10:53:09

回答

2

試試這個

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

謝謝,但它仍然有一個運行時錯誤...你能看到上面的代碼(我剛剛添加他),並告訴我什麼是錯的?... – 2010-07-01 10:39:06

+0

它的作品正確地感謝你這麼多:) – 2010-07-01 12:27:23

0

滾動條把你希望能夠到ScrollView內滾動你的整個佈局的佈局。

+0

對不起,雙張貼。我現在看到ccheneson的反應速度更快。 – 2010-07-01 08:38:23

+0

請注意這些變化,我以爲我已經嘗試了你在說什麼,但我認爲我不是在正確的方向,可能是我得到這個概念是錯誤的嗎?我應該爲每個查看項目做嗎? – 2010-07-01 09:03:38

相關問題