Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/195.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 列表视图的最后两个元素被隐藏_Android_Android Listview - Fatal编程技术网

Android 列表视图的最后两个元素被隐藏

Android 列表视图的最后两个元素被隐藏,android,android-listview,Android,Android Listview,我设计了一个布局,其中我有listview,它将显示200多个列表名称,在底部我有四个按钮 问题是列表视图的最后两个元素隐藏在页脚后面。我搞不懂。 谢谢你的帮助 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" an

我设计了一个布局,其中我有listview,它将显示200多个列表名称,在底部我有四个按钮

问题是列表视图的最后两个元素隐藏在页脚后面。我搞不懂。 谢谢你的帮助

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#ffffff"
    android:orientation="vertical" 
    android:keepScreenOn="true"
    >

    <include
        android:id="@+id/store_screen_action_bar"
        layout="@layout/action_bar" />
    <ListView
        android:id="@+id/store_screen_lists"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@id/store_screen_action_bar"
        android:layout_marginLeft="20dip"
        android:layout_marginRight="20dip"
        android:layout_marginTop="20dip"
        android:cacheColorHint="#00000000"
        android:divider="@drawable/divider_line"
        android:fastScrollEnabled="false"
        android:headerDividersEnabled="false"
        android:smoothScrollbar="true"
        android:listSelector="@android:color/transparent" 
        />
    <TextView 
        android:id="@android:id/empty"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:textSize="15sp"
        android:gravity="center_horizontal|center_vertical" 
        /> 

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#c8d5e1"
        android:gravity="center_horizontal|bottom"
        android:orientation="horizontal"
        android:layout_alignParentBottom="true"
         >

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="5dip"
            android:layout_marginTop="15dip"
            android:orientation="vertical" >

            <ImageButton
                android:id="@+id/store_screen_anouncement"
                android:layout_width="60dip"
                android:layout_height="60dip"
                android:layout_marginLeft="10dip"
                android:layout_marginTop="5dip"
                android:background="@drawable/round_corner"
                android:paddingBottom="40dip"
                android:paddingLeft="30dip"
                android:paddingRight="20dip"
                android:paddingTop="40dip"
                android:src="@drawable/announcement" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginBottom="2dip"
                android:gravity="center_horizontal"
                android:text="@string/annoucement_text"
                android:textColor="#306190"
                android:textSize="12sp" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="5dip"
            android:layout_marginTop="15dip"
            android:orientation="vertical" >

            <ImageButton
                android:id="@+id/store_screen_group"
                android:layout_width="60dip"
                android:layout_height="60dip"
                android:layout_marginLeft="3dip"
                android:layout_marginRight="10dip"
                android:layout_marginTop="5dip"
                android:background="@drawable/round_corner"
                android:padding="20dip"
                android:src="@drawable/groups" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginBottom="2dip"
                android:layout_marginLeft="10dip"
                android:gravity="center_horizontal"
                android:paddingLeft="5dip"
                android:text="@string/groups_text"
                android:textColor="#306190"
                android:textSize="12sp" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="5dip"
            android:layout_marginTop="15dip"
            android:orientation="vertical" >

            <ImageButton
                android:id="@+id/store_screen_interupt_all"
                android:layout_width="60dip"
                android:layout_height="60dip"
                android:layout_marginLeft="10dip"
                android:layout_marginRight="10dip"
                android:layout_marginTop="5dip"
                android:background="@drawable/round_corner"
                android:padding="10dip"
                android:src="@drawable/interrupt" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginBottom="2dip"
                android:layout_marginLeft="10dip"
                android:gravity="center_horizontal"
                android:text="@string/interrupt_text"
                android:textColor="#306190"
                android:textSize="12sp" />
        </LinearLayout>

        <FrameLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dip" >

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginBottom="5dip"
                android:layout_marginTop="5dip"
                android:orientation="vertical" >

                <ImageButton
                    android:id="@+id/store_screen_ear_box"
                    android:layout_width="60dip"
                    android:layout_height="60dip"
                    android:layout_marginLeft="10dip"
                    android:layout_marginRight="10dip"
                    android:layout_marginTop="5dip"
                    android:background="@drawable/round_corner"
                    android:padding="60dip"
                    android:src="@drawable/earbox" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="2dip"
                    android:layout_marginLeft="10dip"
                    android:gravity="center_horizontal"
                    android:paddingLeft="10dip"
                    android:text="@string/earbox_text"
                    android:textColor="#306190"
                    android:textSize="12sp" />
            </LinearLayout>

            <TextView
                android:id="@+id/play_announcement_no_text"
                android:layout_width="25dip"
                android:layout_height="25dip"
                android:layout_gravity="left"
                android:layout_marginRight="5dip"
                android:background="@drawable/green_circle"
                android:gravity="center"
                android:visibility="gone"
                android:textColor="@android:color/white" />

            <TextView
                android:id="@+id/play_message_no_text"
                android:layout_width="25dip"
                android:layout_height="25dip"
                android:layout_gravity="right"
                android:layout_marginBottom="20dip"
                android:background="@drawable/red_circle"
                android:gravity="center"
                android:visibility="gone"
                android:textColor="@android:color/white" />
        </FrameLayout>
    </LinearLayout>

</RelativeLayout>


使用
android:layout\u lower=“@id/list
为您的页脚添加这些属性到
ListView

android:layout_below="@+id/store_screen_action_bar"
android:layout_above="@+id/footer"
并设置
LinearLayout
footer的
id

<LinearLayout
    android:id="@+id/footer"

什么是根布局?根布局是相对的。我已经将整个codeadd id发布到页脚,并将其移动到xml中的listview上方(在include之后)…然后在listview中添加android:over=footer_idI已编辑请查看好的让我试试Selvin然后页脚将不可见?我猜您的列表和页脚重叠,所以最后的列表项位于页脚后面。使用此代码,您将页脚放在列表下。是的,您的页脚将可见