Swift實戰-小QQ(第3章):QQ主介面布局

來源:互聯網
上載者:User

標籤:

1.建一個tabbarController 三個navigationController 三個ViewController

2.將SliderViewController檔案中的initSubViews後面添加代碼:

 //用mainContentView裝下MainTab        var mainTabVC: UITabBarController! = self.storyboard!.instantiateViewControllerWithIdentifier("MainTabViewController") as UITabBarController        mainContentView.addSubview(mainTabVC.view)

3.MessageViewController(訊息),添加代碼:

 override func viewDidLoad()    {        super.viewDidLoad()                //左側顯示頭像        var photoView:UIImageView=UIImageView(image: UIImage(named: "[email protected]"))        photoView.frame=CGRectMake(0, 0, 40, 40)        var photoItem:UIBarButtonItem=UIBarButtonItem(customView: photoView)        self.navigationItem.leftBarButtonItem=photoItem        //    }

 

 

本章未完,待續...

Swift實戰-小QQ(第3章):QQ主介面布局

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.