cordova ios踩坑之路

2017-12-04  本文已影响0人  kamifun

社会我锋哥,人狠话不多……话不多说,start!

- (void)viewWillAppear:(BOOL)animated  
{  
    // View defaults to full size.  If you want to customize the view's size, or its subviews (e.g. webView),  
    // you can do so here.  
    if([[[UIDevice currentDevice]systemVersion ] floatValue]>=7)  
    {  
        CGRect viewBounds=[self.webView  bounds];  
        viewBounds.origin.y=20;  
        viewBounds.size.height=viewBounds.size.height-20;  
        self.webView.frame=viewBounds;  
    }  
  
    [super viewWillAppear:animated];  
} 

PS:更新cordova-plugin-statusbar插件为2.2.3之后,好像失效了
暂时把配置项改成这样

  <preference name="StatusBarStyle" value="defaults" />
// 安装cordova-plugin-keyboard
cordova plugin add cordova-plugin-keyboard

然后在deviceready事件中调用全局Keyboard.shrinkView方法

document.addEventListener('deviceready', () => {
  window.Keyboard.shrinkView(true);
  // 其他代码
  ...............
}
<preference name="KeyboardDisplayRequiresUserAction" value="false" />

持续更新,暂时 只碰到 || 只想起 这几个

上一篇 下一篇

猜你喜欢

热点阅读