2
我有一個滑動抽屜視圖的應用程序。我的問題是,在抽屜活動佈局中,我有一個列表視圖,該列表視圖位於滑動抽屜手柄所在的屏幕底部。所以無法看到列表中的最後一個元素,因爲句柄與它重疊。 我該如何解決這個問題?上面的地方視圖滑動抽屜手柄
在此先感謝!
我有一個滑動抽屜視圖的應用程序。我的問題是,在抽屜活動佈局中,我有一個列表視圖,該列表視圖位於滑動抽屜手柄所在的屏幕底部。所以無法看到列表中的最後一個元素,因爲句柄與它重疊。 我該如何解決這個問題?上面的地方視圖滑動抽屜手柄
在此先感謝!
我認爲解決在我的列表視圖的底部
通過以下步驟添加空間:在佈局文件夾
space_fotter.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/color_appBackground">
<ImageView
android:gravity="center"
android:src = "@drawable/bg_white"
android:layout_width="10dp"
android:layout_height="50dp"
/>
</LinearLayout>
1.創建space_fotter.xml
@ drawable/bg_white它只是我創建的一個小的白色png文件。從列表中activty類
View SpaceFotter = getLayoutInflater().inflate(R.layout.space_fotter, null);
2.call space_fotter.xml它3.添加到您的列表視圖:
private ListView lv;
lv =(ListView)findViewById(android.R.id.list);
lv.addFooterView(SpaceFotter);
希望它能幫助
簡單的方法來做到這一點是將android:layout_marginBottom =「50dp」添加到列表視圖中 – ZoharAdar 2011-04-12 13:54:29