有人可以解釋爲什麼scrollview不顯示他的子元素? 我有textviews的金潤一的LinearLayout內垂直,也就是LinearLayout中滾動視圖內......ScrollView不顯示內容
但我沒有看到任何滾動視圖既不是textviews ..
這裏是XML佈局
<RelativeLayout 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" >
<TextView
android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/scrollViewCheck"
android:gravity="center"
android:padding="10dip"
android:text="Pick which items you want to count"
android:textAppearance="?android:attr/textAppearanceMedium" >
</TextView>
<ScrollView
android:id="@id/scrollViewCheck"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/bottomSettings"
android:scrollbarFadeDuration="0" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Test"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Test"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Test"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Test"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Test"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Test"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Test"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Test"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="Test"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="Test"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
</ScrollView>
<RelativeLayout
android:id="@id/bottomSettings"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<Button
android:id="@+id/timeButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Choose Count Time" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/timeButton"
android:orientation="horizontal" >
<Button
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Back" />
<Button
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Start" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
在此先感謝;)
這固定了整個事情,但哥們有時候我被困在許多佈局......有太多的故障。我的意思是,佈局應該更容易製作,有許多次要的東西會改變整個內容。有什麼方法可以更快更簡單地進行設計嗎? adt活動設計模式並不好.. 謝謝! – TiagoM 2013-04-22 21:36:44
@DarkLink我通常做設計的方式是從一些非常簡單的事情開始,並逐個添加元素。這樣我就知道問題出現在哪裏了。 – Ethan 2013-04-22 21:46:36
是的,這正是我期待的,很多試驗和錯誤,就像David Wasser說的:) 謝謝! – TiagoM 2013-04-22 22:18:24