Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activity中的Fragment使用控件,底部编辑框不显示 #174

Open
MyNameIsShort opened this issue Sep 2, 2022 · 6 comments
Open

Comments

@MyNameIsShort
Copy link

Androidx版本:否
PanelSwitchHelper版本:v1.3.13
手机型号: 红米 note7
手机系统版本: Android 9.0
问题描述:主页Activity多Fragment,底部显示tab栏场景,当控件位于Fragment中,控件(内容区域RecyclerView,下方输入框),显示出来的效果为recyclerView与底部tab栏衔接,下方输入框并未展示;输入框添加下边距后能够展示,但是点击输入框,软键盘与输入框中间有一段间距,可能是tab栏。

image
image
onGlobalLayout
image

@jiqianwen
Copy link

请问,大佬解决了吗?我也遇到同样的问题。。。

@HeroZ-Dodge
Copy link
Collaborator

请问你现在用的是什么版本,为了方便沟通,可以加入我们的交流群
image

@haoguibao
Copy link

请问解决了吗,遇到了同样的问题。谢谢。

@Arey688
Copy link

Arey688 commented Oct 12, 2023

image

请问解决了吗,遇到了同样的问题。谢谢。

@HeroZ-Dodge
Copy link
Collaborator

你能上传个xml文件,我先看看这个场景的UI结构,然后看看怎么兼容

@skyCracks
Copy link

skyCracks commented Jan 24, 2024

这个场景在主页面底部TAB导航栏+ViewPager2,在Fragment中使用确实会出现遮挡问题,目前找到一种取巧的方案(测试设备少,兼容性未知),实现如下:

代码:
val mHelper = PanelSwitchHelper.Builder(this)
.addKeyboardStateListener {
onKeyboardChange { visible, _ ->
binding.space.isVisible = !visible
}
}.build(false)

XML:
<com.effective.android.panel.view.PanelSwitchLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:animationSpeed="standard"
>

    <com.effective.android.panel.view.content.RelativeContentContainer
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:edit_view="@id/testEdit">

        <LinearLayout
            android:id="@+id/bottomLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:orientation="vertical">

            <EditText
                android:id="@+id/testEdit"
                android:layout_width="match_parent"
                android:layout_height="40dp"
                android:layout_marginHorizontal="16dp"
                android:gravity="center_vertical"
                android:hint="请输入你想说的"
                android:paddingHorizontal="16dp"
                android:paddingVertical="0dp"
                android:textSize="14dp"
                 />

          <!-- android:layout_height="50dp" 为Tab导航栏高度,自行更改
            <View
                android:id="@+id/space"
                android:layout_width="match_parent"
                android:layout_height="50dp"
                android:background="@color/white"
                />

        </LinearLayout>

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/testRecyclerView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_above="@+id/bottomLayout"
            />

    </com.effective.android.panel.view.content.RelativeContentContainer>

    <com.effective.android.panel.view.panel.PanelContainer
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >


    </com.effective.android.panel.view.panel.PanelContainer>

</com.effective.android.panel.view.PanelSwitchLayout>

看更新日志V1.5.5就支持ViewPager2了,但是我用的V1.5.7版本,文档和demo没找到库自带的处理方案。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants