0
即使當我的佈局中只有一個TextView時,如何使垂直線性佈局始終可滾動?Android中的線性佈局始終可滾動
- 當我向上滾動時,我希望它滾動並在底部顯示一個空白區域。
- 當我向下滾動時,我希望它在我的視圖頂部顯示空白。
這裏是我的代碼:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ScrollView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/addCategory"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Scrollable view"/>
</LinearLayout>
</ScrollView>
也許這可以給你一些提示http://stackoverflow.com/questions/14747525/how-can-i-make-bounce-effect-to-listview-as-in-ios。但正如在開發人員表中所說,不要嘗試實現另一個操作系統的UI – mihail