gpt4 book ai didi

android - 滚动时使用协调器布局的额外空间

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:13:10 24 4
gpt4 key购买 nike

在我的应用程序中,我正在使用 CoordinatorLayout。当我尝试滚动时,有很多可用的额外空间。我已经通过使用设置协调器布局高度来更改它。但是当我尝试更改显示额外空间的选项卡时。当我单击表格 tab1、tab2、tab3 没有问题。但是当我尝试在 tab3 和 tab2 中处理 tab3、tab2、tab1 时,显示出很多额外空间。

1) In my main activity am using Observable scrollview.

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/kudix_cordinator"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:fitsSystemWindows="false"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:layout_collapseMode="pin">

<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/htab_collapse_toolbar"
android:layout_width="match_parent"
android:layout_height="250dp"
android:layout_marginBottom="0dp"
app:contentScrim="?attr/colorPrimary"
app:titleEnabled="false">

<ImageView

android:layout_width="match_parent"
android:layout_height="@dimen/parallax_image_height"
android:background="@drawable/ic_launcher"
android:fitsSystemWindows="true"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax" />

<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
app:tabIndicatorColor="@android:color/white"
app:tabSelectedTextColor="@android:color/white"
app:tabTextColor="@color/white" />

</android.support.design.widget.CollapsingToolbarLayout>

</android.support.design.widget.AppBarLayout>


<android.support.v4.view.ViewPager
android:id="@+id/kudix_club_viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="10dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
/>
</android.support.design.widget.CoordinatorLayout>

每个选项卡 fragment 包含不同类型的 UI。

最佳答案

实际上它是从另一个布局中获取我的 ListView 高度。进度对话框没有关闭所以 API 继续调用。在那个 API 中我正在设置协调器布局高度。对于每个选项卡我设置协调器布局高度。

关于android - 滚动时使用协调器布局的额外空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43584505/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com