uniapp input框聚焦時軟鍵盤彈起整個頁面上滑,固定頁面不讓上滑問題


根據需求,軟鍵盤彈起時,不允許頁面整體向上滑動

用到的屬性是:  :adjust-position="false"    

 

uni-app 軟鍵盤頂起底部fixed定位的輸入框 頁面就不會上滑

<view class="cu-bar search bg-white" style="position: fixed;left: 0;bottom: '鍵盤彈的高度';width: 100%;z-index: 9999;" >
	<view class="search-form">
		<input :adjust-position="false" type="text" placeholder=" 請輸入信息"  v-model="my_say_text"></input>
		<button @click="to_send" type="primary" style="height: 64upx;line-height: 64upx;margin-left: 16upx;background: #FF5959;">發送</button>
	</view>
</view>

  

 

 

 把這個值賦給fixed定位中的 bottom即可     

:style="{bottom: inputOffsetBottom > 0 ? inputOffsetBottom + 'px' : '0'}"

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM