鍍金池/ 問(wèn)答/HTML/ iOS 鍵盤會(huì)頂起導(dǎo)航欄,隱藏鍵盤底部布局不還原

iOS 鍵盤會(huì)頂起導(dǎo)航欄,隱藏鍵盤底部布局不還原

iOS 鍵盤會(huì)頂起導(dǎo)航欄,隱藏鍵盤底部布局不還原
圖片描述
圖片描述
圖片描述

經(jīng)過(guò)恨多次不同的嘗試,還是一樣的問(wèn)題,附上所有的頁(yè)面代碼,煩請(qǐng)幫忙看看,謝謝了

<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?'關(guān)注':'已關(guān)注'}}</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">全部評(píng)論</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}}回復(fù)</text>
                            <text v-else style="color: rgb(20,20,20);font-size: 20;text-align: center;">回復(fù)</text>
                        </div>
                    </div>
                </div>
            </cell>
        </list>
        <div style="bottom: 0;background-color: #FFFFFF;height: 88;align-items:center;flex-direction: row">
            <div >
                <input placeholder="請(qǐng)輸入" :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>
回答
編輯回答
別逞強(qiáng)

@佘貞標(biāo)
您好!感謝你的解答,我嘗試使用flex布局,結(jié)果還是一樣。我附上了我的頁(yè)面結(jié)構(gòu),請(qǐng)指點(diǎn)一下謝謝了。

<template>
<div>
    <!--長(zhǎng)列表 -->
    <list>
    ...
    </list>
    
    <!--底部評(píng)論菜單 -->
    <div style="flex: 1;bottom: 0;background-color: #FFFFFF;height: 88;align-items:center;flex-direction: row">
            <div style="flex: 4;">
                <input placeholder="請(qǐng)輸入" :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 style="flex: 1">
                <div style="background-color: #0088fb;border-radius: 10; width: 110;height:60;justify-content: center">
                    <text style="color: white;text-align: center;font-size: 24" @click="send">發(fā)送</text>
                </div>
            </div>
    </div>
</div>
</template>
2017年3月25日 19:07
編輯回答
寫榮

ios fixed在可視界面高度寬度發(fā)生變化時(shí)會(huì)出現(xiàn)異常,比如軟鍵盤彈起收起。建議使用flex布局,在使用flex兼容性寫法的情況下,flex基本可以兼容市面的手機(jī)了。使用flex不會(huì)出現(xiàn)布局異常的情況。

2018年3月16日 21:41
編輯回答
女流氓

是weex的SDK源碼的問(wèn)題,手動(dòng)改一下吧

./platforms/ios/Pods/WeexSDK/ios/sdk/WeexSDK/Sources/Component/WXEditComponent.m

?文件路徑根據(jù)自己的項(xiàng)目找一下,找到WXEditComponent.m里的blur方法

文件路徑根據(jù)自己的項(xiàng)目找一下,找到WXEditComponent.m里的blur方法,然后添加一行

[[NSNotificationCenter defaultCenter] postNotificationName:UIKeyboardWillHideNotification object:nil];

在失去焦點(diǎn)的時(shí)候重置一下位置就好了

2018年9月13日 10:42