javascript - 按 CSS Styled 按钮会出现不需要的键盘 UIWebView
<p><p>我在 UIWebView 中加载了一个本地 html 资源。一个按钮使用 CSS 设置样式,按下时会显示不需要的键盘并允许在按钮上输入</p>
<p>在我的本地 html 文件中</p>
<pre><code> <style>
.button {
border: 0px solid #ed1717;
background: #e01414;
background: -webkit-gradient(linear, left top, left bottom, from(#e01414), to(#e01414));
background: -webkit-linear-gradient(top, #e01414, #e01414);
background: -moz-linear-gradient(top, #e01414, #e01414);
background: -ms-linear-gradient(top, #e01414, #e01414);
background: -o-linear-gradient(top, #e01414, #e01414);
background-image: -ms-linear-gradient(top, #e01414 0%, #e01414 100%);
padding: 14px 28px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: rgba(255,255,255,0.4) 0 0px 0, inset rgba(255,255,255,0.4) 0 0px 0;
-moz-box-shadow: rgba(255,255,255,0.4) 0 0px 0, inset rgba(255,255,255,0.4) 0 0px 0;
box-shadow: rgba(255,255,255,0.4) 0 0px 0, inset rgba(255,255,255,0.4) 0 0px 0;
color: #ffffff;
font-size: 17px;
font-family: helvetica, serif;
text-decoration: none;
vertical-align: middle;
}
</style>
</code></pre>
<p>html按钮本地资源</p>
<pre><code> align=center ><INPUT onclick=calculate(this.form) class=button value="Press" name=calculate_button>
</code></pre></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>尝试将 <code>type="button"</code> 属性设置为输入元素。这应该可以解决问题:)</p></p>
<p style="font-size: 20px;">关于javascript - 按 CSS Styled 按钮会出现不需要的键盘 UIWebView,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/21202903/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/21202903/
</a>
</p>
页:
[1]