问题
I'm building an app using Ionic 2.
Not sure if this is related to Ionic 2 or Cordova, but maybe you can guide me in the right direction.
I'm using an InAppBrowser component to show an HTML page which have an HTML select component, and when the options are shown in iOS the "done" button is not shown, so a selection can't be made.
This is happening in the emulator and in a real device. It works fine in android.
I'm attaching an image just in case, but I did reproduce this in other websites too.
Screenshot
回答1:
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
window.cordova.plugins.Keyboard.hideKeyboardAccessoryBar(false);
};
回答2:
This is because iOS needs the extra InAppBrowser Option: presentationstyle: "formsheet"
, to render those buttons:
this.inAppBrowser.create(
url,
target,
{
presentationstyle: "formsheet", // iOS only option
},
);
As described in this answer, which answers basically the same question: https://stackoverflow.com/a/51149158/10005883
来源:https://stackoverflow.com/questions/40594119/ios-inappbrowser-not-showing-html-select-properly