android - 底部导航视图涵盖 MapboxMap - Android
问题描述
我尝试了许多不同的东西,但无法解决这个问题!无论我尝试什么,地图都会溢出来填满整个屏幕,导致导航栏覆盖地图的属性/底部。
我认为这可能是因为我已将 layout_behaviour 设置为在滚动时隐藏,但是删除它并不能解决问题。任何建议表示赞赏。:)
我想保留隐藏导航栏的功能,因为其他几个 viewpager 选项卡正在使用它。
主要活动
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/main_appbar"
android:layout_height="wrap_content"
android:layout_width="match_parent">
<android.support.design.widget.TabLayout
android:id="@+id/reading_tab_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways"
app:tabGravity="fill"
app:tabMaxWidth="0dp"
app:tabMode="fixed">
<android.support.design.widget.TabItem
android:id="@+id/reading1_tab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Reading1" />
<android.support.design.widget.TabItem
android:id="@+id/reading2_tab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Reading2" />
<android.support.design.widget.TabItem
android:id="@+id/reading3_tab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Reading3" />
</android.support.design.widget.TabLayout>
</android.support.design.widget.AppBarLayout>
<com.liftyourheads.dailyreadings.utils.CustomViewPager
android:id="@+id/mainViewPager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
<android.support.design.widget.BottomNavigationView
android:id="@+id/navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginStart="0dp"
android:layout_marginEnd="0dp"
android:background="?android:attr/windowBackground"
app:layout_behavior="@string/hide_bottom_view_on_scroll_behavior"
app:menu="@menu/navigation"/>
<!--app:layout_anchorGravity="bottom"-->
<!--app:layout_anchor="@+id/mainViewPager"-->
</android.support.design.widget.CoordinatorLayout>
分段
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:mapbox="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.liftyourheads.dailyreadings.activities.MainActivity"
android:id="@+id/map_fragment_root_id">
<!--android:layout_marginBottom="200dp"-->
<com.mapbox.mapboxsdk.maps.MapView
android:id="@+id/bibleMapView"
android:layout_width="match_parent"
android:layout_height="match_parent"
mapbox:mapbox_cameraTargetLat="40.73581"
mapbox:mapbox_cameraTargetLng="-73.99155"
mapbox:mapbox_styleUrl="@string/mapbox_style_custom_bible"/>
<FrameLayout
android:id="@+id/mapOverlay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0.5"
android:background="@android:color/background_dark"
android:visibility="invisible" />
</android.support.design.widget.CoordinatorLayout>
解决方案
推荐阅读
- vba - VBE IE 如何单击标题和/或 onclick?
- c# - 限制类实例化
- mysql - 如何获取特定日期范围的最新数据?
- python - 将表连接到栅格属性表以创建具有重新分类值 python 或 R 的新栅格
- html - 如何使用 css nth-child(-n+3) 仅显示列表中的前三个图像
- python - 随机值张量上的计算(例如 tf.greater 和 tf.cond)未按预期工作
- python - 许多属性的内联循环命名元组
- sql - 如何从 SQL 中带有 WHERE 条件的下一条记录中获取值?
- symfony - 如何在 Sonata configureListFields 中检索主题而不是行动?
- proxy - 使用 Burp 拦截 http 请求不起作用?