若Activity中的內容太多,或是ListView的項目超過畫面 可以在Activity加上捲軸

畫面上方加上

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="fill_parent" android:layout_height="fill_parent" >

畫面下方加上 </ScrollView>

注意:注意原來在<LinearLayout>或<RelativeLayout>裡的 android="http://schemas.android.com/apk/res/androi 要去掉

範例:

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="fill_parent" android:layout_height="fill_parent" >

<RelativeLayout android:layout_width="match_parent"

android:layout_height="wrap_content" > . . . . </RelativeLayout>

</ScrollView>

arrow
arrow
    全站熱搜

    Felix 發表在 痞客邦 留言(0) 人氣()