iOS 键盘会顶起导航栏,隐藏键盘底部布局不还原
经过恨多次不同的尝试,还是一样的问题,附上所有的页面代码,烦请帮忙看看,谢谢了
<template>
<!--<navpage style="display: flex;flex-direction: column"
dataRole="none"
:height="navBarHeight"
backgroundColor="#1296DB"
leftItemSrc="http://onnqn1z06.bkt.clouddn.com/image/close.png"
:title="title"
titleColor="white"
@naviBarLeftItemClick="naviBarLeftItemClick">-->
<list style="height: 999;flex:1;overflow: auto;-webkit-overflow-scrolling: touch">
<cell>
<div style="border-bottom-width: 2;border-bottom-color: #F5F5F5;padding-bottom: 30">
<div style="margin-top:20;margin-right:10;margin-left:10;flex-direction: row;justify-content: center;align-items: center;" @click="userIndex(comment.userId)">
<div style="flex: 1;flex-direction: row;align-items: center;" >
<image style="height: 80;width: 80;border-radius: 50;" :src="comment.avatar" :placeholder="placeholderImg"></image>
<text style="margin-left: 10;color: #333333;font-size: 30">{{comment.nickname}}</text>
</div>
<div style="flex: 2;align-items: flex-end;margin-right: 40">
<div v-if="subscribehide" @click="follow" item="ture" :style="{backgroundColor:subscribe==0?'#1296DB':'',borderWidth:(subscribe=='1'?'1':'0'),borderColor:subscribe==1?'#d5d5d5':''}" style="border-radius: 50;width: 100;height: 45;justify-content: center;align-items: center;">
<text :style="{color:subscribe==0?'white':'#c3c3c3'}" style="font-size:24">{{subscribe==0?'关注':'已关注'}}</text>
</div>
</div>
</div>
<div class="content" style="margin-left: 90;margin-right: 15;font-size: 25">
<text style="color: #454434;font-size: 28">{{comment.content}}</text>
<text style="color: rgb(20,20,20);font-size: 25;margin-top: 10">{{comment.createDateText}}</text>
</div>
</div>
</cell>
<cell>
<div>
<text style="color: #c8c8c8;font-size: 30;margin-left: 20;margin-top: 20">全部评论</text>
</div>
</cell>
<cell v-for="(commItem,index) in commentReplyList">
<div style="margin-left: 10;margin-right: 10;margin-top: 20">
<div style="flex-direction: row;justify-content: center;align-items: center;">
<div style="flex: 1; flex-direction: row;align-items: center" @click="userIndex(commItem.userId)">
<image style="height: 60;width: 60;border-radius: 50;" :src="commItem.avatar" :placeholder="placeholderImg"></image>
<text style="color: #406599;margin-left: 10;font-size: 26">{{commItem.nickname}}</text>
</div>
<div style="flex: 2;align-items: flex-end;margin-right: 30;">
<div style="flex-direction: row;align-items: center;" @click="zanEvaer" :item="commItem">
<image v-if="commItem.isLike==1" src="http://onnqn1z06.bkt.clouddn.com/image/yzan.png" style="width: 30;height: 30"></image>
<image v-if="commItem.isLike==0" src="http://onnqn1z06.bkt.clouddn.com/image/zan2.png" style="width: 30;height: 30"></image>
<text style="color: #aaaaaa;font-size: 25">{{commItem.likecount}}</text>
</div>
</div>
</div>
<div style="margin-left: 70;">
<text style="color: rgb(20,20,20);font-size: 24">{{commItem.content}}</text>
<div style="flex-direction: row;align-items: center;margin-top: 10;">
<text style="color: rgb(20,20,20);font-size: 20;">{{commItem.createDateText}}·</text>
<text v-if="commItem.commentcount>0" style="color: rgb(20,20,20);font-size: 20;border-radius: 30;padding-left: 10;height: 35;text-align: center;line-height: 35; padding-right: 10;background-color: #F7F5F6">{{commItem.commentcount}}回复</text>
<text v-else style="color: rgb(20,20,20);font-size: 20;text-align: center;">回复</text>
</div>
</div>
</div>
</cell>
</list>
<div style="bottom: 0;background-color: #FFFFFF;height: 88;align-items:center;flex-direction: row">
<div >
<input placeholder="请输入" :value="sendcomment" return-key-type="send" @return = "onreturn" @input="onincommentInput" ref="commentInput" type="text" style="background-color:#FAFAFA;width:575;border-width:1;border-color:#EEEEEE;border-radius: 10; height: 60;font-size: 24;padding-left: 10"/>
</div>
</div>
<!--</navpage>-->
</template>
<script>
module.exports = {
data: {
domHeight:0,
},
created: function() {
this.domHeight = weex.config.env.deviceHeight / weex.config.env.deviceWidth*750 - (88*2+50);
}
}
</script>
ios fixed在可视界面高度宽度发生变化时会出现异常,比如软键盘弹起收起。建议使用flex布局,在使用flex兼容性写法的情况下,flex基本可以兼容市面的手机了。使用flex不会出现布局异常的情况。