CoordinatorLayout 留空底部空间

2023-12-12

我正在使用 Xamarin 开发 Android 应用程序。我使用 ViewPager 和 TabLayout 来进行选项卡导航,但我的 ViewPager 即使使用 height="match_parent" 也不会填充整个屏幕。 我相信这是 CoordinatorLayout 上的一些配置错误,但我找不到修复它的方法。

我的布局 XML:

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="0dp"
    android:background="@android:color/holo_blue_bright">
    <ImageView
        android:background="@drawable/background_aulas"
        android:layout_height="wrap_content"
        android:layout_width="match_parent" />
    <android.support.design.widget.AppBarLayout
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:background="@android:color/transparent"
        android:id="@+id/appbarlayout">
        <include
            android:id="@+id/toolbar"
            layout="@layout/toolbar" />
        <android.support.design.widget.TabLayout
            android:id="@+id/aulas_tabs"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingTop="75px"
            local:tabMode="scrollable" />
    </android.support.design.widget.AppBarLayout>
    <android.support.v4.view.ViewPager
        android:id="@+id/aulas_viewpager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        local:layout_behavior="@string/appbar_scrolling_view_behavior"
        android:layout_weight="1"
        android:background="#FF0000"
        android:layout_alignParentBottom="@id/appbarlayout" />
</android.support.design.widget.CoordinatorLayout>

这是我的屏幕截图:https://i.stack.imgur.com/fN9hE.jpg


尝试以下操作。

<?xml version="1.0" encoding="utf-8"?>
    <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:local="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="0dp"
    android:fitsSystemWindows="true"
    android:background="@android:color/holo_blue_bright">
  <LinearLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical">
  <ImageView
      android:layout_height="wrap_content"
      android:layout_width="match_parent" />
  <android.support.design.widget.AppBarLayout
      android:layout_height="wrap_content"
      android:layout_width="match_parent"
      android:background="@android:color/transparent"
      android:id="@+id/appbarlayout">
    <include
        android:id="@+id/toolbar"
        layout="@layout/toolbar" />
    <android.support.design.widget.TabLayout
        android:id="@+id/aulas_tabs"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingTop="75px"
        local:tabMode="scrollable" />
  </android.support.design.widget.AppBarLayout>
  <android.support.v4.view.ViewPager
      android:id="@+id/aulas_viewpager"
      android:layout_width="match_parent"
      android:layout_height="0dp"
      local:layout_behavior="@string/appbar_scrolling_view_behavior"
      android:layout_weight="1"
      android:background="#FF0000"
      android:layout_alignParentBottom="@id/appbarlayout" />
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

CoordinatorLayout 留空底部空间 的相关文章

随机推荐

  • asp.net mvc 不断用 .wml 覆盖 text/html 内容类型

    我正在开发一个可以在移动 手机 设备上查看的网站 我只是使用纯 HTML 4 01 没有什么特别的 除了诺基亚 Series 40 第 1 5 版之外 这些页面在我们测试过的所有移动浏览器上都呈现良好 仔细观察 IIS 似乎会自动渲染内容类
  • BitBucket - 直接添加到开发分支而不是主分支

    我们正在将 SCM 更改为 BitBucket 目前我们使用 Clearcase SCM 我们在不同阶段 流中拥有代码 开发 UAT 和生产 其中开发具有开发人员当前正在处理的代码 UAT 已完成由 BP 测试的更改 而生产具有部署到生产的
  • 为文本区域内的线条着色

    有没有办法让textarea显示颜色的线条 我想要实现的是每隔一行都着色 即白色 灰色 白色 灰色 白色 灰色 以获得更好的可读性 用户应该写很多东西 比如 输入名称 每一个都从新行开始 无论如何 我确实使用 jQuery 所以如果他们为此
  • 带返回值的跨域弹窗

    这是设置 我在两个不同的域上有两个网站 www website1 com www someotherwebsite com 这就是我想做的 当用户开机时www website1 com然后单击一个链接 我想要一个弹出窗口显示www some
  • 使用 gdb 在多屏幕窗口中调试 MPI

    如果我有一个 MPI 程序 想要使用 gdb 进行调试 同时能够查看所有单独进程的输出 我可以使用 mpirun n
  • DbContext.OnConfiguring 没有被调用并且在 ASP.NET Core 中表现得很奇怪

    在我的 asp net core 项目中我有一个ReadingContext类派生自DbContext 根据文件OnConfiguring应该为每个实例调用DbContext即被创建 但就我而言 仅当我在调试时检查实例时才会调用它 我里面有
  • 如何在使用 AMD 时在 Backbone.js 中加载引导模型 (require.js)

    Backbone js 文档建议以这种方式加载引导模型 但这是一个不能使用的模式AMD 方法 使用 require js 唯一可能的解决方案是声明存储 JSON 数据的全局变量并稍后在相关初始化方法中使用该变量 有没有更好的方法这样做 没有
  • 为什么有些 Gulp 流默认“流动”,而另一些则不流动?

    考虑这两个 gulp 任务 gulp task src function done gulp src docs on end function console log ending done gulp task dest function
  • Firebase Cloud Functions 未记录,似乎未部署

    Firebase Cloud Functions 自大约 10 年后就没有记录过 今天下午4点 它们似乎也没有正确部署 但在没有日志的情况下很难判断 网站上以及使用 firebase 函数 日志 运行 cli 时缺少日志 有人知道出了什么问
  • 最小年龄验证 laravel

    我想验证用户信息 例如出生日期 因为我在验证中使用了以下语句行 但是如何使其动态 以便用户的最低年龄可以为 13 岁 低于该年龄的用户无法注册 return Validator make data first name gt require
  • 如何将按钮的DataContext更改为父级DataContext?

    我在 WPF 中有 2 个课程 Meeting People 在会议中我有 2ObservableCollections AttendingMeeting and NotAttendingMeeting包含People objects 在
  • 将数组类型导入hana?

    我正在使用 CSV 文件将数据导入 SAP HANA 当我尝试导入具有数组类型的列时 会导致以下错误 ARRAY 类型与 PARAMETER TYPE 不兼容 例如 CREATE COLUMN TABLE SCHEMA TABLE ID I
  • 尝试使用图形 API 从 Azure Active Directory 获取组时 Authorization_RequestDenied

    我尝试使用 Graph API 获取有关 Azure Active Directory 组的信息 但不断收到 Authorization RequestDenied 响应 这个问题类似于尝试使用 Azure AD Graph API 获取登
  • 将方法作为参数传递[重复]

    这个问题在这里已经有答案了 我正在使用 C 中的一个库 其中的方法要求我将目标方法的字符串名称作为参数传递 出于显而易见的原因 我想避免使用硬编码字符串 因此我将编写一个中间 util 方法 该方法采用一个方法 获取名称 大概通过反射 并将
  • 使用python在父函数中调用的子函数中访问父函数的变量

    在 Python 3 4 中 我想调用在父函数外部定义的子函数 该子函数仍然可以访问父函数的作用域 请参见下面的示例 虽然为了便于查看 我在下面的示例中将函数命名为父函数和子函数 但我正在考虑的函数具有非常独立的任务 因此单独定义它们更有意
  • iOS 模拟器仅在屏幕的四分之一处显示应用程序

    自 2 天以来 当在模拟器中启动应用程序时 它会打开应用程序屏幕大小的 1 4 iPhone 6 并用 iPhone 6 Plus 进行了测试 就连家也只有四分之一大小 Cleaned the project Reset contents
  • 尝试在 Windows 上创建 Heroku 应用程序时出错

    当我尝试做的时候heroku create我收到以下错误消息 d Ruby187 lib ruby gems 1 8 gems heroku 2 0 1 lib heroku command base rb 83 in read No su
  • Python += 带有列表和元组[重复]

    这个问题在这里已经有答案了 我在网上看到有人写了一个有趣的Python行 但不明白为什么它有效 所以我们可以在 python 解释器中尝试以下几行 s 1 s s 1 1 这将导致错误 TypeError 只能将列表 而不是 元组 连接到列
  • OS X 上的 Python 2.7:TypeError:“frozenset”对象不可在每个命令上调用

    我使用 Python 的每个命令都出现此错误 tmp sudo easy install pip Traceback most recent call last File usr bin easy install 2 7 line 11 i
  • CoordinatorLayout 留空底部空间

    我正在使用 Xamarin 开发 Android 应用程序 我使用 ViewPager 和 TabLayout 来进行选项卡导航 但我的 ViewPager 即使使用 height match parent 也不会填充整个屏幕 我相信这是