使用ListView无法查看BottomBar

时间:2018-02-25 11:50:00

标签: android listview navbar bottombar

我有这段代码:

<android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/swipeContainer"
    xmlns:design="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:orientation="vertical"
    android:weightSum="1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:theme="@style/Theme.AppCompat"
    tools:context="com.tag.instagramdemo.example.MainActivity"
    android:background="@drawable/background1">

    <ListView

        android:id="@+id/lvRelationShip"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >

    </ListView>
<android.support.design.widget.BottomNavigationView
android:id="@+id/bottomBar"
android:layout_width="match_parent"
android:layout_height="64dp"
android:layout_gravity="bottom"
android:background="#ffffff"
xmlns:app="http://schemas.android.com/apk/res-auto"
app:itemIconTint="@color/text"
android:enabled="false"
app:itemTextColor="@color/text"
android:animateLayoutChanges="true"
android:clickable="false"
design:menu = "@menu/menu_main"
android:contextClickable="false"/>    

当我使用此布局时。我无法看到底栏,我只能看到列表视图。在顶部有列表,没有别的。

1 个答案:

答案 0 :(得分:0)

  1. 如果您尚未添加父版面,请添加父版面。将listview包含在swiperefreshlayout中并附上底栏&amp;父布局内的swiperefreshlayout(例如,相对布局)

    Sub FindInCellFormatWithBullets()
        Dim BIOCell As Range
        Dim findRange As Range
        Dim found As Boolean
    
        With ActiveDocument
            Set BIOCell = .Range(Start:=.Tables(1).Cell(13, 2).Range.Start, _
                End:=.Tables(1).Cell(13, 2).Range.End)
            Set findRange = BIOCell.Duplicate
            BIOCell.Select
        End With
    
         With findRange.Find
            .Text = "as follows: "
            found = .Execute
            If found Then
                findRange.MoveStart wdParagraph, 1
                findRange.End = BIOCell.End - 2
                findRange.ListFormat.ApplyListTemplateWithLevel ListTemplate:= _
                   ListGalleries(wdBulletGallery).ListTemplates(1), ContinuePreviousList:= _
                   False, ApplyTo:=wdListApplyToWholeList, DefaultListBehavior:= _
                   wdWord10ListBehavior
            Else
                MsgBox "couldn't find it"
            End If
        End With
    
    End Sub
    

  2. 也可以使用

  3.   

    应用程式:菜单

    代替<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:design="http://schemas.android.com/apk/res-auto" ....> <android.support.v4.widget.SwipeRefreshLayout android:id="@+id/swipeContainer" ...> <ListView android:id=... > </ListView> </android.support.v4.widget.SwipeRefreshLayout> <android.support.design.widget.BottomNavigationView android:id="@+id/bottomBar" android:layout_width="match_parent" android:layout_height="64dp" android:layout_gravity="bottom" android:background="#ffffff" android:enabled="false" app:itemIconTint="@color/colorAccent" app:itemTextColor="@color/colorPrimary" android:animateLayoutChanges="true" android:clickable="false" android:contextClickable="false" android:layout_below="@id/swipeContainer" app:menu = "@menu/menu_main"/> ,如 https://medium.com/@chornenkyy.v/first-look-at-bottomnavigationview-from-android-design-library-8244de85b953

      

    BottomNavigationView有一个方法inflateMenu(菜单),如果你通过   你的菜单资源文件将起作用。紧跟着想法   错误的命名空间出现在我的脑海中,所以我试图用'替换'设计'   'app'命名空间,可自动解析属性。它   实际上有效。存在的其他三个属性的相同故事   特别是对于这个视图:itemBackground,itemIconTint,   itemTextColor。