2016-12-21 41 views
-1

我有這樣的一套代碼:導航控制器視圖大小,使其適合[迅速]

MOLPay = MOLPayLib(delegate: self, andPaymentDetails: paymentRequestDict) 

    let navigationController = UINavigationController(rootViewController: MOLPay) 

    let btn: UIButton = UIButton(frame: CGRectMake(0, 0, 35, 35)) 
    btn.setImage(UIImage(named: "scan_ic_back.png"), forState: UIControlState.Normal) 
    btn.addTarget(self, action: #selector(MolPayNowViewController.closeMolPay(_:)), forControlEvents: UIControlEvents.TouchUpInside) 

    let barButton = UIBarButtonItem(customView: btn) 

    MOLPay.navigationItem.leftBarButtonItem = barButton 

    MOLPay.navigationController?.navigationBar.barTintColor = UIColor(hexString: "#76DD4A") 

    self.presentViewController(navigationController, animated: true, completion: nil) 

而且它出來變成這個樣子,我想展示頁面大小適合屏幕大小,而是如何做它?自從它是嵌入式導航控制器。有人可以請幫助。

enter image description here

我想什麼archieve:

enter image description here

+0

你想在頂部有除去白色空間? – Sweeper

+0

@Sweeper我剛更新了我的問題,請再看看,謝謝 – bobo

回答

0

你的問題是,你的UIWebView不調整其內容,使之適合手機的屏幕。我對嗎?

,使整個網絡視圖的內容適合屏幕,這樣做的視圖控制器:

yourWebView.scalesPageToFit = true 
+0

我剛更新了我的問題,請再看看,謝謝 – bobo

+0

@bobo回答編輯 – Sweeper