Javascript Ionicframework、cordova和ios模拟器表单输入问题
我附上了一个视频,因为我很难解释我遇到的问题: 实际上,我自己设计了表单输入,它们工作起来很有魅力,但当我在ios模拟器上测试fomr时,我会这样做:Javascript Ionicframework、cordova和ios模拟器表单输入问题,javascript,css,cordova,input,ionic-framework,Javascript,Css,Cordova,Input,Ionic Framework,我附上了一个视频,因为我很难解释我遇到的问题: 实际上,我自己设计了表单输入,它们工作起来很有魅力,但当我在ios模拟器上测试fomr时,我会这样做: 集中输入 触摸并滚动页面 然后表单输入被设置为默认背景,正如您在视频中看到的那样,它会得到一个白色背景,而我在css中指定这样的输入必须完全没有背景 我尝试了多种方式使用css,如: .input-huge:focus, .input-huge:focus:hover{ background:none; } 但它仍然不起作用 有什么想法
.input-huge:focus, .input-huge:focus:hover{
background:none;
}
但它仍然不起作用
有什么想法吗
这是html:
<ion-view data-title="Submit Shop" ng-controller="Submit">
<ion-content>
<div class="separator50"></div>
<div>
<input class="row input-huge text-center light" ng-model="newShop.name" type="text" placeholder="Shop Name">
</div>
<div class="separator50"></div>
<div>
<input class="row input-huge text-center light" ng-model="newShop.city" type="text" placeholder="City">
</div>
<div class="separator50"></div>
<div>
<input class="row input-huge text-center light" ng-model="newShop.address" type="text" placeholder="Address">
</div>
<div class="separator10"></div>
<div class="separator30"></div>
<div class="row">
<button ng-click="submit()" class="button button-light button-block font-family-1" ng-class="{'disabled':newShop.processing}">
<span ng-show="!newShop.processing" class="positive"> Submit</span>
<span ng-show="newShop.processing"><i class="icon ion-refreshing"></i></span>
</button>
</div>
</ion-content>
</ion-view>
感谢您的建议给予
背景色:透明代码>或背景色:rgba(0,0,0,0)代码>一次尝试。如果有帮助,请告诉我。如果不重置-webkit外观,您可能无法覆盖默认背景属性(白色)。试试这个
input.input-huge {
-webkit-appearance: none;
background: none;
text-align: center;
font-size: 20px;
padding-bottom:40px;
color:#fff;
border-bottom:1px solid rgba(0, 0, 0, 0.08);
}
input.input-huge:focus {
background: none;
}
更新:我创建了一个。在iOS模拟器中的测试显示了工作结果
更新2:尝试使用更多合格的选择器
试试背景:透明代码>。我不确定是否background:none代码>有效。您的示例很难调试。你能创建一个包含所有添加样式依赖项的文件吗?@mlnmln style是默认的ionicframework样式我没有改变任何东西,只是添加了我在上面发布的规则,它不会像你所看到的那样工作,但它不工作,可能是因为当焦点+滚动时输入被重置,而不仅仅是焦点!?我的小提琴中可能缺少一些样式依赖项。我无法在没有所有信息的情况下重新创建您的确切版本。仍然无法获得您需要的内容,只需创建一个新的ionicframework应用程序并构建ios平台,添加我在我的系统中的问题上粘贴的css规则,告诉我它是否适用于您,或者您得到的是与视频中相同的结果。如果您可以创建一个公开的示例(可以使用Safari开发工具进行检查)来重现您的确切问题,那么会容易得多。不仅仅是一段视频和一堆代码片段。或者,由于一些限制,这对你来说是不可能的?我有一些限制,而且错误只发生在ios模拟器上,而不是safari上,我不可能公开模拟器:P
input.input-huge {
-webkit-appearance: none;
background: none;
text-align: center;
font-size: 20px;
padding-bottom:40px;
color:#fff;
border-bottom:1px solid rgba(0, 0, 0, 0.08);
}
input.input-huge:focus {
background: none;
}