你好,歡迎來到IOS教程網

 Ios教程網 >> IOS使用技巧 >> IOS技巧綜合 >> childViewController 小計

childViewController 小計

編輯:IOS技巧綜合
[摘要]本文是對childViewController 小計的講解,對學習IOS蘋果軟件開發有所幫助,與大家分享。

設置childViewcontroller

self.ganZhi_vc = [board instantiateViewControllerWithIdentifier:@"HDGanZhiViewController"];
    [self addChildViewController:self.ganZhi_vc];
    
    self.data_vc = [board instantiateViewControllerWithIdentifier:@"HDDataViewController"];
    [self addChildViewController:self.data_vc];
    
    self.map_vc = [board instantiateViewControllerWithIdentifier:@"HDMapViewController"];
    [self addChildViewController:self.map_vc];
    
    self.code_vc = [board instantiateViewControllerWithIdentifier:@"HDCodeViewController"];
    [self addChildViewController:self.code_vc];
    
    [self.view addSubview:self.root_vc.view];
    [self.root_vc didMoveToParentViewController:self];
    _currentViewController = self.root_vc;

界面跳轉

-(void)changeViewControllerWith:(UIViewController *)temp
{
    if (_currentViewController != temp) {
        __weak ViewController *weaSelf = self;
        [self transitionFromViewController:_currentViewController toViewController:temp duration:1.0 options:UIViewAnimationOptionLayoutSubviews animations:nil completion:^(BOOL finished) {
        }];
        _currentViewController = temp;
    }
    
}
  1. 上一頁:
  2. 下一頁:
蘋果刷機越獄教程| IOS教程問題解答| IOS技巧綜合| IOS7技巧| IOS8教程
Copyright © Ios教程網 All Rights Reserved