iOS 11 Xcode9 适配

2017-11-29  本文已影响23人  Zhui_Do

1.tableview下移 automaticallyAdjustsScrollViewInsets弃用

        if #available(iOS 11.0, *) {
            tableView.contentInsetAdjustmentBehavior = .never
        } else {
            automaticallyAdjustsScrollViewInsets = false;
        };

2.导航栏图片按钮形变: customView不能直接设置button需要加在UIView上,customView设置为view

        let moreBtn = UIButton()
        moreBtn.frame = CGRect(x:0,y:0,width:60,height: 30)
        moreBtn.setBackgroundImage(UIImage(named:"top_menu_more.png"), for: .normal)
        moreBtn.addTarget(self, action:  #selector(MoreClick), for: .touchUpInside)
        
        let moreView = UIView()
        moreView.frame = CGRect(x:0,y:0,width:60,height: 30)
        moreView.addSubview(moreBtn)
        let right = UIBarButtonItem.init(customView: moreView)
      
        self.navigationItem.rightBarButtonItem = right

3.IQKeyboardManager 不显示完成按钮
更新至5.0.6版本

上一篇 下一篇

猜你喜欢

热点阅读