解决安卓键盘点击发送按钮后收回的问题,实现键盘常驻(转载)

解决安卓app聊天页面点击发送按钮后键盘收起的问题,实现键盘常驻
用两个input,获取焦点实现键盘常驻,直接给项目的代码给搬过来了,有什么不懂可以私信我

<view class="footer-center" :style="{width:tex+'%'}">
//内容输入框
	<textarea cursor-spacing="10" class="input-text uni-input"  auto-height :focus="softfocus" maxlength="120" @blur="softblur" @focus="msgfocus" v-model="inputValue" @input="inputchange" />
</view>
<!-- 安卓 -->
<view>
	<view v-show="sendflag==false" class="footer-right1" @tap="showmenu" :style="{width:btn+'%'}">
	    //图片控制的是按钮和加号图片的切换  可忽略
		<image v-if="menucheck == false" style="width: 52upx;height: 52upx;margin:auto;margin-top: 15%;" src="../../../static/infomenu.png" mode=""></image>
		<image v-if="menucheck == true" style="width: 52upx;height: 52upx;margin:auto;margin-top: 15%;" src="../../../static/infomenucheck.png" mode=""></image>
	</view>
	//此处input是个按钮
	<input class="send-btn1" :style="{width:btnwd+'%'}" v-show="sendflags==true" maxlength="0" @blur="sendblur" @focus="sendfocus" @tap="sendMessge" type="text" placeholder="发送" placeholder-style="color:#fff"/>
</view>


//JS代码
sendfocus:function(){
var that=this;
that.sendblur();
},
sendblur:function(){
var that=this;
that.softfocus = true;
},
//css代码
.send-btn1{
position: absolute;
right: 3%;
top: 30upx;
outline: none;
color: transparent;
caret-color: rgba(0, 0, 0, 0);
/* width: 104upx; */
height: 68upx;
line-height: 68upx;
text-align: center;
background-image: linear-gradient(#387aff, #1440e6);
color:#fff;
border-radius: 6px;
margin:auto;
font-size: 28upx;
}
.footer-right1{
display: flex;
justify-content: center;
align-items: center;
color: #2878ff;
z-index: 9;
position: absolute;
right: 0;
background: #fff;
height:70%;
}
原文链接:https://blog.csdn.net/zzqq205/article/details/106188470?utm_medium=distribute.pc_feed.none-task-blog-alirecmd-6.nonecase&depth_1-utm_source=distribute.pc_feed.none-task-blog-alirecmd-6.nonecase&request_id=

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值