Android 安卓用户界面因键盘而调整大小?
我正在开发一个聊天应用程序。最近,我将聊天、活动(无延迟)改为片段(调整大小时有这么多延迟),因为我想构建一个灵活的UI,但现在我的问题是:当键盘出现或消失时,UI的调整非常缓慢 我试图改变舱单内的调整盘和其他->不工作 当我从de chat->中删除recyclerview时,它可以工作,键盘显示时没有延迟 所以我想问题就在这里(我不确定), 我注意到这个错误:没有连接适配器;跳过布局 我试图用stackoverflow上的其他帖子修复它,但没有成功。当我滚动recyclerview或出现键盘时,也会出现此错误 当我的适配器中有很多消息时,视图在调整大小时会非常滞后 关于架构 main活动有一个容器。 容器可以包含片段:FamilyFragment、SettingFragment、RootChatFragment RootChatFragment->构建灵活的用户界面(Contact Fragment和ChatFragment),如果是移动视图,则只需联系Fragment即可 有人能帮我吗?(对不起,我的英语不好) 这是我关闭键盘时的屏幕截图。 已更新、已修复 使用android:layout\u weight=“value”是个问题,但我不知道为什么 老的Android 安卓用户界面因键盘而调整大小?,android,user-interface,keyboard,resize,fragment,Android,User Interface,Keyboard,Resize,Fragment,我正在开发一个聊天应用程序。最近,我将聊天、活动(无延迟)改为片段(调整大小时有这么多延迟),因为我想构建一个灵活的UI,但现在我的问题是:当键盘出现或消失时,UI的调整非常缓慢 我试图改变舱单内的调整盘和其他->不工作 当我从de chat->中删除recyclerview时,它可以工作,键盘显示时没有延迟 所以我想问题就在这里(我不确定), 我注意到这个错误:没有连接适配器;跳过布局 我试图用stackoverflow上的其他帖子修复它,但没有成功。当我滚动recyclerview或出现键盘
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="20dp"
android:fillViewport="true">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment android:name="com.myapp.fragments.SpaceContact"
android:id="@+id/contact_fragment"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="match_parent" />
<fragment android:name="com.myapp.fragments.SpaceChat"
android:id="@+id/chat_fragment"
android:layout_weight="2"
android:layout_width="0dp"
android:layout_height="match_parent" />
</LinearLayout>
</RelativeLayout>
新的没有滞后
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="20dp"
android:fillViewport="true">
<RelativeLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment android:name="com.myapp.fragments.SpaceContact"
android:id="@+id/contact_fragment"
android:layout_width="350dp"
android:layout_height="match_parent" />
<fragment android:name="com.myapp.fragments.SpaceChat"
android:id="@+id/chat_fragment"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_toRightOf="@+id/contact_fragment"
android:layout_alignParentRight="true"
/>
</RelativeLayout>
</RelativeLayout>