一,ios打包配置 1.狀態欄重疊
第一次打包發現狀態欄重疊,網上搜索的原生代碼無效。最后通過在config.xml里設置實現。
<PReference name="StatusBarOverlaysWebView" value="false" />(重要) <preference name="StatusBarStyle" value="default" /> <preference name="StatusBarBackgroundColor" value="#72C147"/>第二次打包發現頂部好了.但是header下面有一段margin,找到ionic.CSS(9600+行) 全部注釋。
/*.platform-ios.platform-cordova:not(.fullscreen) .bar-header:not(.bar-subheader) { height: 64px; }*//* .platform-ios.platform-cordova:not(.fullscreen) .bar-header:not(.bar-subheader).item-input-inset .item-input-wrapper { margin-top: 19px !important; } .platform-ios.platform-cordova:not(.fullscreen) .bar-header:not(.bar-subheader) > * { margin-top: 20px; }*//*.platform-ios.platform-cordova:not(.fullscreen) .tabs-top > .tabs,.platform-ios.platform-cordova:not(.fullscreen) .tabs.tabs-top { top: 64px; }.platform-ios.platform-cordova:not(.fullscreen) .has-header,.platform-ios.platform-cordova:not(.fullscreen) .bar-subheader { top: 64px; }.platform-ios.platform-cordova:not(.fullscreen) .has-subheader { top: 108px; }.platform-ios.platform-cordova:not(.fullscreen) .has-header.has-tabs-top { top: 113px; }.platform-ios.platform-cordova:not(.fullscreen) .has-header.has-subheader.has-tabs-top { top: 157px; }*/2.隱藏啟動頁的加載圖標 config.xml里面
<preference name="ShowSplashScreenSpinner" value="false"/>3.強制豎屏 config.xml里面
<preference name="orientation" value="portrait" />二。bug修復
1.ios input會出現blur時把頂部頂到不見的情況 一般情況下在 內加入 overflow-scroll=”false”可以解決。
2.yhh項目的Ajax的采用angular的$http封裝,不再采用之前封裝的jquery的ajax,但是傳輸方式有點變化,需要在app.js 的 config
$httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8';$httpProvider.defaults.transformRequest = function(data){ if (data === undefined) { return data; }; return $.param(data); };封裝時 $http設置
headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}。3.
4.android4.4以下webview的表現很差,于是集成crosswalk 直接安裝插件:
cordova plugin add cordova-plugin-crosswalk-webview5.ios上無法格式化‘2005-01-12’的時間格式,需要替換成‘2005/01/12’的格式。
.replace(/-/g,"/"))6.輪播圖更新后需要手動調用
$ionicSlideBoxDelegate.update();//更新$ionicSlideBoxDelegate.loop(true);//循環7.debug包可以連接電腦開啟調試模式,要求系統>=4.4
谷歌瀏覽器輸入:Chrome://inspect8.ios鍵盤擋住輸入框。特別是底部單獨有一個輸入框的情況的解決方法 (http://blog.csdn.net/lovelyelfpop/article/details/52033045) ios 的配置 config.xml 加入以下配置
<preference name="KeyboardShrinksView" value="true" /> <preference name="DisableScrollingWhenKeyboardShrinksView" value="true" />新聞熱點
疑難解答