简体   繁体   English

Ionicframework,cordova和ios模拟器形成输入问题

[英]Ionicframework , cordova and ios simulator form input issue

I attach a video cause its hard for me to explain the problem i'm getting: 我附加了一个视频,导致我难以解释我遇到的问题:

https://vid.me/5Mo https://vid.me/5Mo

Actually i styled by my own the form inputs and they works like a charm but when i test the fomr on ios simulator i do this: 实际上,我是通过自己的形式输入来设置样式的,它们的工作方式就像一种魅力,但是当我在ios模拟器上测试fomr时,我这样做:

  1. focus the input 集中输入
  2. touch scroll the page 触摸滚动页面

then the form input is rsetted to the default background as you can see in the video it gets a white background, while i specified in css that such inputs has to be without background at all. 然后将表单输入设置为默认背景,就像您在视频中看到的那样,它会变成白色背景,而我在CSS中指定此类输入必须完全没有背景。

I tryed in many ways using the css like: 我尝试使用CSS进行多种方式,例如:

 .input-huge:focus, .input-huge:focus:hover{
  background:none;
}

but it still wont work. 但它仍然无法正常工作。

Any idea? 任何想法?

this is the html: 这是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>

and this is my styled inputs in css : 这是我在CSS中的样式输入:

input.input-huge{
  background: none;
  text-align: center;
  font-size: 20px;
  padding-bottom:40px;
  color:#fff;
  border-bottom:1px solid rgba(0,0,0,0.08);
}

thanks in advice 感谢建议

Give background-color: transparent; 赋予background-color: transparent; or background-color: rgba(0,0,0,.0); background-color: rgba(0,0,0,.0); a try. 尝试一下。 Let me know if that helps. 让我知道是否有帮助。

It is possible that you can't overwrite the default background property (white) without resetting -webkit-appearance . 如果不重置-webkit-appearance ,可能无法覆盖默认的背景属性(白色)。 Try this 尝试这个

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

Update: I created a jsfiddle . 更新:我创建了一个jsfiddle Testing in iOS Simulator shows working results. 在iOS Simulator中进行测试可显示工作结果。

Update 2: Tried using more qualified selectors. 更新2:尝试使用更多合格的选择器。

Reference 参考

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM