android布局高度大于屏幕高度,Android CoordinatorLayout + AppbarLayout + Viewpager布局超过屏幕高度...

在尝试将ViewPager与CoordinatorLayout和AppbarLayout结合使用时,遇到一个问题:ViewPager的内容超出了屏幕的高度,导致部分元素被裁剪。布局代码中设置了必要的属性,但仍然无法解决这个问题。寻求解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

当我把Viewpager与CoordinatorLayout + AppbarLayout + Viewpager一起使用时,viewpager超出屏幕大小,请帮我解决。Android CoordinatorLayout + AppbarLayout + Viewpager布局超过屏幕高度

xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:app="http://schemas.android.com/apk/res-auto"

android:id="@+id/main_content"

android:layout_width="match_parent"

android:layout_height="match_parent">

android:id="@+id/appbar"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

android:id="@+id/toolbar"

android:layout_width="match_parent"

android:layout_height="?attr/actionBarSize"

android:background="?attr/colorPrimary"

app:popupTheme="@style/ThemeOverlay.AppCompat.Light"

app:layout_scrollFlags="scroll|enterAlways|snap" />

android:id="@+id/tabs"

android:layout_width="match_parent"

android:layout_height="wrap_content" />

android:id="@+id/container"

android:layout_width="match_parent"

android:layout_height="match_parent"

app:layout_behavior="@string/appbar_scrolling_view_behavior" />

962ce2d73954e8c6ba0e56d9c1f45629.png

936a12ed304d6e5491951a463a5a50eb.png

正如你所看到的,ViewPager的高度超过其引起下面一些裁剪元素的父布局,我不知道为什么?

+0

u能PLZ在设备上运行,并再次 –

+0

CHK给它的屏幕截图@vishal patel bro –

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值