开发者

Disabling iPhone keyboard for textarea in web application

开发者 https://www.devze.com 2023-01-15 20:19 出处:网络
So I have multiple textareas on my page that are editable depending on a users status.The problem is that even when a user 开发者_JAVA技巧clicks on a textarea that they are not allowed to edit, the ke

So I have multiple textareas on my page that are editable depending on a users status. The problem is that even when a user 开发者_JAVA技巧clicks on a textarea that they are not allowed to edit, the keyboard comes up on mobile safari. The user can't actually edit the textarea, but it's really annoying/looks bad. I was thinking of maybe making it disabled but without actually changing it's look. Any suggestions?


Are you using TextView or TextField? For a TextView you can set Editable to NO to prevent the keyboard being popped up.

For TextField I guess you can set userInteractionEnabled to NO. Haven't tried this before though.


Have you tried disabling the input/textarea field? I think if you click on that the keyboard says closed.

<index disabled />

or

<textarea disabled />
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号