android键盘顶起布局原理,android如何把键盘弹出不影响布局?

我想只把键盘和输入框那个layout弹上去

只有键盘弹出,而且toolbar的颜色会延生到下面

bVsqTo

这是设置为adjustPan以后,会把整个界面顶上去,我只想顶输入框

bVsqTq

activity_chat.xml

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

xmlns:tools="http://schemas.android.com/tools"

android:layout_width="match_parent"

android:layout_height="match_parent"

tools:context=".activities.ChatActivity">

android:id="@+id/vRevealBackground"

android:layout_width="match_parent"

android:layout_height="match_parent" />

android:id="@+id/vChatRoot"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:orientation="vertical">

android:id="@+id/chatRecyclerview"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_weight="1"

android:divider="#ffff0000"

android:dividerHeight="10dp" />

android:id="@+id/llSend"

android:layout_width="match_parent"

android:layout_height="@dimen/send_button_height"

android:background="@color/white"

android:elevation="@dimen/default_elevation"

android:gravity="center_vertical"

android:paddingBottom="4dp"

android:paddingLeft="8dp"

android:paddingRight="8dp"

android:paddingTop="8dp">

android:id="@+id/etSend"

android:layout_width="0dp"

android:layout_height="wrap_content"

android:layout_weight="1"

android:textColor="#555555"

android:textSize="14sp" />

android:id="@+id/btnSend"

android:layout_width="72dp"

android:layout_height="match_parent"

android:layout_marginBottom="2dp"

android:layout_marginLeft="8dp"

android:background="@drawable/btn_send"

android:elevation="4dp"

android:orientation="vertical" />

view_toolbar.xml

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

android:id="@+id/app_bar_layout"

android:layout_width="match_parent"

android:layout_height="wrap_content"

app:elevation="3dp">

android:id="@+id/toolbar"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:background="?attr/colorPrimary"

android:fitsSystemWindows="true"

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

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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值