具體的狀況:html
在模擬器中沒問題,但是在真機下就出現如下問題, <textarea />在一個view盒子中,view盒子是固定定位,頁面滑動時候,固定定位的盒子會定在屏幕的相對位置,可是盒子中的textarea組件(字)會跟隨頁面滑動(組件固定在了相對頁面的位置,而非屏幕的相對位置)。app
解決: 學習
官方文檔中有說起-->若是 textarea 是在一個 position:fixed
的區域,須要顯示指定屬性 fixed 爲 true。優化
官方文檔連接:https://mp.weixin.qq.com/debug/wxadoc/dev/component/textarea.html spa
1 <textarea name="textarea" class="canael_textarea" fixed="true"/>
注意:debug
屬性的填寫,fixed默認是 false的,可是若是有業務須要變更狀態(某狀態要false,某狀態要true),則須要添加綁定,直接寫false會默認轉化爲true。code
好比 : fixed="true" (結果爲true), fixed="false"(結果也會是true),因此須要綁定參數component
1 <textarea name="textarea" class="canael_textarea" fixed="{{tag}}"/>
2 3 var app = getApp(); 4 Page({ 5 6 data:{ 7 tag:false 8 } 9 })
總結:以上內容供學習總結分享,有什麼不對的地方或可優化的地方,歡迎各位多多指教。htm