1

我正在制作一个应用程序,在该应用程序中,我将数据从 JSON 提取到 ListView 中,但是每当我将更多记录提取到 listview 中时,我的底部标签栏不会在那时隐藏,但是如果我在 listview 中有少量记录,例如:-只有 3 或 4 个项目行,然后我可以看到我的记录,当我使用静态列表视图时,我没有遇到同样的问题,因为我同时获得了大量带有固定底部标签栏的记录,所以可能我知道可能是什么问题?

4

2 回答 2

1

您可以按照以下步骤操作:

  1. 使用相对布局。

  2. 将底栏与底部对齐为:

    android:layout_alignParentBottom="true"
    
  3. 将底部栏上方的列表视图设置为:

    android:layout_above="@+id/bottomBarId"
    

它仅适用于相对布局。

希望它会有所帮助。

于 2012-10-19T04:42:03.243 回答
1

看到这个, list 和 bottom_bar 的父布局应该是

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<ListView
    android:id="@+id/listView1"
    android:layout_width="match_parent"
    android:layout_height="fill_parent"
    android:layout_above="@+id/bottombar" >
</ListView>

<LinearLayout
    android:id="@+id/bottombar"
    android:layout_width="fill_parent"
    android:layout_height="70dip"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    android:gravity="center" >

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Bottom Tab bar"
        android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>

</RelativeLayout>
于 2012-10-19T04:44:53.343 回答