小编use*_*673的帖子

列表视图下方的页脚固定在屏幕底部

我试图在我的列表视图下面有一个页脚.

这是怎么做的.

<?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="fill_parent"
android:background="@color/white"
android:orientation="vertical" >

<ListView
    android:id="@android:id/list"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:divider="#BE6D79"
    android:dividerHeight="3dp" />

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="30dp"
    android:background="@color/darkDetna"
    android:orientation="horizontal" >

    <Button
        android:id="@+id/contactBtn"
        android:layout_width="wrap_content"
        android:layout_height="30dp"
        android:layout_weight="1"
        android:background="@drawable/listselector"
        android:paddingRight="0dip"
        android:text="Contact" />

    <Button
        android:id="@+id/faq"
        android:layout_width="wrap_content"
        android:layout_height="30dp"
        android:layout_weight="1"
        android:background="@drawable/listselector"
        android:padding="0dip"
        android:text="Terms And Conditions" />

    <Button
        android:id="@+id/feedback"
        android:layout_width="wrap_content"
        android:layout_height="30dp"
        android:layout_weight="1"
        android:background="@drawable/listselector"
        android:padding="0dip"
        android:text="Feedback  " />

    <Button
        android:id="@+id/fullSIte"
        android:layout_width="wrap_content"
        android:layout_height="30dp"
        android:layout_weight="1"
        android:background="@drawable/listselector"
        android:padding="0dip"
        android:text="Full Site" />
</LinearLayout>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

这里

但问题是列表内容很小,或者页脚视图下方只有一个列表项.

我希望页脚固定在屏幕的底部.

在此先感谢您的时间和帮助.

android listview android-layout android-listview

4
推荐指数
1
解决办法
1万
查看次数

从另一个片段调用一个片段

我解释的事情非常糟糕,我会努力做到最好:)

我试图使用Tabhost并在每个选项卡中显示列表片段.

[tabview中的ListFragments]:在此输入图像描述

这是它的外观.

单击列表元素后,将调用另一个片段以显示详细信息,如下所示.[在列表元素上单击]:在此输入图像描述 有两个问题.

  1. DetailsFragment不是全屏.即能够看到列表(你可以在上图中看到)
  2. 当我回到标签视图并单击列表时,它会显示: "java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread.[in ListView(16908298, class android.widget.ListView) with Adapter(class android.widget.SimpleAdapter)] "TabView xml:

    <TabHost
        android:id="@android:id/tabhost"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >
    
        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:orientation="vertical" >
    
            <TabWidget
                android:id="@android:id/tabs"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="0"
                android:orientation="horizontal" />
    
            <FrameLayout
                android:id="@android:id/tabcontent"
                android:layout_width="0dp"
                android:layout_height="0dp"
                android:layout_weight="0" />
    
            <FrameLayout
                android:id="@+android:id/realtabcontent"
                android:layout_width="fill_parent"
                android:layout_height="0dp" …
    Run Code Online (Sandbox Code Playgroud)

android list tabview android-fragments

2
推荐指数
1
解决办法
2万
查看次数