textarea固定定位在低端,即类似贴吧那种评论输入框。当获取焦点拉起键盘时,IOS的状态栏和顶部tab会被拉下来。
< textarea type = 'text' focus = '{{true}}' maxlength = '200' auto-height = '{{true}}' fixed = '{{true}}' bindinput = "followValueInput" > |
为固定定位
{ position : fixed ; bottom : 0 ; left : 0 ; right : 0 ; } |
通过修改textarea属性进行了各种尝试。
show-confirm-bar或者adjust-position设为false会出现输入框被键盘挡住的情况。
希望尽快解决。
我知道为什么没复现了,我改了下代码片段。需要有底部tab
就随便填了个appid 就预览了下
你是真机上试了么?代码片段咋真机调?。。
键盘往上顶多少导航栏就下来多少 我看了你的代码片段好像没问题啊
我今天才写到这,之前我也不清楚。
楼主我是昨天出现的情况 之前都没事 代码也没改动 你那边一直出现吗
代码片段是一种可分享的小项目,可用于分享小程序和小游戏的开发经验、展示组件和 API 的使用、复现开发问题等等。分享代码片段会得到一个链接,所有拥有此分享链接的人可以在工具中导入此代码片段。如果网页可点击的链接指向的是分享链接,那么点击链接也会自动打开工具进入代码片段导入页。你可以参照小程序文档来创建代码片段
通过设置
<
textarea
type
=
'text'
focus
=
'{{true}}'
maxlength
=
'200'
auto-height
=
'{{true}}'
fixed
=
'{{true}}'
adjust-position
=
'{{false}}'
bindinput
=
"followValueInput"
></
textarea
>
可以解决nav位移问题。。。但是输入框就被键盘挡住了。
2楼可以先试着这么解决。但是我这项目就不行了。。。。
<
view
class
=
'follow-input-wrapper'
wx:if
=
'{{followActionId}}'
>
<
view
class
=
'follow-mask'
catchtap
=
'closeFollow'
></
view
>
<
view
class
=
'input-area'
>
<
textarea
type
=
'text'
focus
=
'{{true}}'
maxlength
=
'200'
auto-height
=
'{{true}}'
fixed
=
'{{true}}'
bindinput
=
"followValueInput"
></
textarea
>
<
view
class
=
'follow-btn'
catchtap
=
'submitFollow'
>评论</
view
>
</
view
>
</
view
>
css
.follow-input-wrapper {
position
:
fixed
;
top
:
0
;
bottom
:
0
;
left
:
0
;
right
:
0
;
box-sizing: border-box;
z-index
:
2
;
display
: flex;
flex-
direction
: column;
align-items: stretch;
}
.follow-mask {
width
:
100%
;
flex:
1
;
}
.input-area {
display
: flex;
flex-
direction
: row;
align-items: flex-start;
background-color
:
#f5f5f5
;
width
:
100%
;
}
.input-area > textarea {
width
:
80%
;
border
:
1
rpx
solid
#DBDBDB
;
background-color
:
#fff
;
color
:
#1c1c1c
;
min-height
:
60
rpx;
font-size
:
32
rpx;
line-height
:
50
rpx;
padding
:
0
10
rpx;
}
.follow-btn {
width
:
20%
;
height
:
64
rpx;
background-color
:
#f86824
;
color
:
#fff
;
text-align
:
center
;
line-height
:
64
rpx;
font-size
:
32
rpx;
}
js应该没关系
帮顶 我也遇到了这个问题 不过我没用定位 就出现了 这两天出现的