离子选择缺少iOs中的顶部确认部分

Hug*_*Hou 1 select ios ionic-framework

所以我使用标准代码选择如下:

<label class="item item-input item-select" ng-class="{ 'has-error-lr' : postTaskForm.type.$invalid  && postTaskForm.$submitted, 'valid-lr' : postTaskForm.type.$valid  && postTaskForm.$submitted}">
      <div class="input-label"> Video Job Type: </div>
      <select ng-model="postTask.type" name="type" ng-required="true">
        <option>Commercial</option>
        <option>Interview</option>
        <option selected>Training Lesson</option>
        <option>Live Event Recording</option>
      </select> 
    </label>
Run Code Online (Sandbox Code Playgroud)

在iOs中渲染时,它看起来像这样:

在此输入图像描述

如您所见,顶部确认部分完全缺失.怎么了?如何在本地iO中获取确认按钮?

Jes*_*ton 9

在你的app.js文件中,你应该看到这段代码

angular.module('config', [])

.run(function($ionicPlatform) {
  $ionicPlatform.ready(function() {
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
    // for form inputs)
    if(window.cordova && window.cordova.plugins.Keyboard) {
      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
    }
    if(window.StatusBar) {
      StatusBar.styleDefault();
    }
  });
})
Run Code Online (Sandbox Code Playgroud)

尝试设置cordova.plugins.Keyboard.hideKeyboardAccessoryBar(false);而不是真

所以这是最终的代码

angular.module('config', [])

.run(function($ionicPlatform) {
  $ionicPlatform.ready(function() {
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
    // for form inputs)
    if(window.cordova && window.cordova.plugins.Keyboard) {
      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(false);
    }
    if(window.StatusBar) {
      StatusBar.styleDefault();
    }
  });
})
Run Code Online (Sandbox Code Playgroud)

显然你的一些代码会有所不同,重要的是将hideKeyboardAccessoryBar更改为false.