我在UIWebView中加载了本地html资源。一个按钮的样式为CSS,当按下该按钮时,会显示一个不需要的键盘并允许在该按钮上键入

在我的本地html文件中

 <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>

html按钮本地资源
        align=center ><INPUT onclick=calculate(this.form) class=button value="Press" name=calculate_button>

最佳答案

尝试将type="button"属性设置为输入元素。这应该可以解决问题:)

09-11 19:27
查看更多