Titaniumを試してみているところで躓いたのでメモ。
Titanium SDK 3.2.3 の場合、WebViewを表示すると初期状態でキーボードが表示されていた。
これを非表示にする。
メモ
- iPhoneエミュレータでは表示されていなかったが、Androidだと表示されていた。
- キーボードの左右移動ボタンで画面が左右にスクロールしていたので、PCでブラウザを使っている際のキーボードのような動きをするのかなと思った。
- Titanium SDKを 3.2.2.GA に落としてみたら表示されなくなった。
対策
これを追加
webview.softKeyboardOnFocus = Ti.UI.Android.SOFT_KEYBOARD_HIDE_ON_FOCUS;
※コメントより、対策を教えて頂きました!
念のためソース
app/controllers/index.js
var window = Titanium.UI.createWindow({
navBarHidden: true,
});
var webview = Ti.UI.createWebView({
url: 'http://MyWebSite/',
// width: Titanium.Platform.displayCaps.platformWidth,
// height: Titanium.Platform.displayCaps.platformHeight,
width: "100%",
height: "100%",
enableZoomControls: false,
disableBounce: true
});
// コレを追加
webview.softKeyboardOnFocus = Ti.UI.Android.SOFT_KEYBOARD_HIDE_ON_FOCUS;
window.add(webview);
window.open();