解决方案 »

  1.   

    把那个view向下移动tababr的高度。。
      

  2.   

    如果你不是自己写的tabbar,,那个黑色有可能是系统的tabbar表示占位的,有个属性,你把它取消掉
      

  3.   


    我在viewDidLoad 里面设置 view的frame,没有任何效果,然后我在view的重载函数setFrame里打印发现,它在我设置之后还会被系统调用很多次,就是说,我的设置在前,系统设置在后,又把view的位置设置回去了,我到底要在哪里设置它的位置比较好啊
      

  4.   


    请问这个占位属性是在代码里设置吗,还是在storyboard里啊,谢谢
      

  5.   


    请问这个占位属性是在代码里设置吗,还是在storyboard里啊,谢谢
    storyboard
      

  6.   


    我在viewDidLoad 里面设置 view的frame,没有任何效果,然后我在view的重载函数setFrame里打印发现,它在我设置之后还会被系统调用很多次,就是说,我的设置在前,系统设置在后,又把view的位置设置回去了,我到底要在哪里设置它的位置比较好啊

    你最后一个pic显示你那view上有2个tabbar的占位  这种情况,最好不要全部都用tabbar,你考研用一个tabbat+分段按钮
      

  7.   


    请问这个占位属性是在代码里设置吗,还是在storyboard里啊,谢谢
    storyboard实在不知道怎么去设置这个占位
      

  8.   


    我在viewDidLoad 里面设置 view的frame,没有任何效果,然后我在view的重载函数setFrame里打印发现,它在我设置之后还会被系统调用很多次,就是说,我的设置在前,系统设置在后,又把view的位置设置回去了,我到底要在哪里设置它的位置比较好啊

    你最后一个pic显示你那view上有2个tabbar的占位  这种情况,最好不要全部都用tabbar,你考研用一个tabbat+分段按钮这个方法好像也可以,但是上下两个tabbar的场合应该也有把
      

  9.   


    我在viewDidLoad 里面设置 view的frame,没有任何效果,然后我在view的重载函数setFrame里打印发现,它在我设置之后还会被系统调用很多次,就是说,我的设置在前,系统设置在后,又把view的位置设置回去了,我到底要在哪里设置它的位置比较好啊

    你最后一个pic显示你那view上有2个tabbar的占位  这种情况,最好不要全部都用tabbar,你考研用一个tabbat+分段按钮这个方法好像也可以,但是上下两个tabbar的场合应该也有把也许你看别人的看起来象tabbar的,其实就是几个美化的button实现同级切换非要做成上下tabbar的也行。。我帮你在网上找找有没有。。
      

  10.   


    我在viewDidLoad 里面设置 view的frame,没有任何效果,然后我在view的重载函数setFrame里打印发现,它在我设置之后还会被系统调用很多次,就是说,我的设置在前,系统设置在后,又把view的位置设置回去了,我到底要在哪里设置它的位置比较好啊

    你最后一个pic显示你那view上有2个tabbar的占位  这种情况,最好不要全部都用tabbar,你考研用一个tabbat+分段按钮这个方法好像也可以,但是上下两个tabbar的场合应该也有把http://www.gowhich.com/blog/172  这个是隐藏tabbaar的。tabbar在顶部,就需要设置view。frame
     contentView.frame = CGRectMake(contentView.bounds.origin.x,  contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height + self.tabBarController.tabBar.frame.size.height);    
      

  11.   


    我在viewDidLoad 里面设置 view的frame,没有任何效果,然后我在view的重载函数setFrame里打印发现,它在我设置之后还会被系统调用很多次,就是说,我的设置在前,系统设置在后,又把view的位置设置回去了,我到底要在哪里设置它的位置比较好啊

    你最后一个pic显示你那view上有2个tabbar的占位  这种情况,最好不要全部都用tabbar,你考研用一个tabbat+分段按钮这个方法好像也可以,但是上下两个tabbar的场合应该也有把http://code4app.com/ios/Sliding-Tabs/4f72eab96803fa8a50000000  看看这个怎么设置tabbar在顶部的
      

  12.   


    我在viewDidLoad 里面设置 view的frame,没有任何效果,然后我在view的重载函数setFrame里打印发现,它在我设置之后还会被系统调用很多次,就是说,我的设置在前,系统设置在后,又把view的位置设置回去了,我到底要在哪里设置它的位置比较好啊

    你最后一个pic显示你那view上有2个tabbar的占位  这种情况,最好不要全部都用tabbar,你考研用一个tabbat+分段按钮这个方法好像也可以,但是上下两个tabbar的场合应该也有把http://www.gowhich.com/blog/172  这个是隐藏tabbaar的。tabbar在顶部,就需要设置view。frame
     contentView.frame = CGRectMake(contentView.bounds.origin.x,  contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height + self.tabBarController.tabBar.frame.size.height);    这个真的可以了,已经达到我想要的效果了,谢谢谢谢我的storyboard里的关系是
    TabBarController1----TabBarController2-----ViewControler21
                                                                     -----ViewController22
                                 ------ViewController11我是想设置TabBarController2的TabBar到顶部,然后把其中的View扩展的下部
    我在ViewControler21 里 设置self.view的frame没有效果
    但是在ViewControler21 里 按照如下设置就又效果了
    UIView *contentView;
        if ( [[self.tabBarController.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]] )
            contentView = [self.tabBarController.view.subviews objectAtIndex:1];
        else
            contentView = [self.tabBarController.view.subviews objectAtIndex:0];
        contentView.frame = CGRectMake(contentView.bounds.origin.x,  contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height + self.tabBarController.tabBar.frame.size.height);我有点晕了,这里的view的层级好像很复杂啊,请问有没有清晰一点的层级结构图啊
      

  13.   


    请问这个占位属性是在代码里设置吗,还是在storyboard里啊,谢谢
    storyboard实在不知道怎么去设置这个占位
      

  14.   

    我发现直接在TabBarController2里调用如下代码
    UIView *contentView;
        if ( [[self.tabBarController.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]] )
            contentView = [self.tabBarController.view.subviews objectAtIndex:1];
        else
            contentView = [self.tabBarController.view.subviews objectAtIndex:0];
        contentView.frame = CGRectMake(contentView.bounds.origin.x,  contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height + self.tabBarController.tabBar.frame.size.height);或者  如下代码UIView *contentView;
        if ( [[self.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]] )
            contentView = [self.view.subviews objectAtIndex:1];
        else
            contentView = [self.view.subviews objectAtIndex:0];
        contentView.frame = CGRectMake(contentView.bounds.origin.x,  contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height + self.tabBarController.tabBar.frame.size.height);都可以达到我想要的效果
      

  15.   


    我在viewDidLoad 里面设置 view的frame,没有任何效果,然后我在view的重载函数setFrame里打印发现,它在我设置之后还会被系统调用很多次,就是说,我的设置在前,系统设置在后,又把view的位置设置回去了,我到底要在哪里设置它的位置比较好啊

    你最后一个pic显示你那view上有2个tabbar的占位  这种情况,最好不要全部都用tabbar,你考研用一个tabbat+分段按钮这个方法好像也可以,但是上下两个tabbar的场合应该也有把http://www.gowhich.com/blog/172  这个是隐藏tabbaar的。tabbar在顶部,就需要设置view。frame
     contentView.frame = CGRectMake(contentView.bounds.origin.x,  contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height + self.tabBarController.tabBar.frame.size.height);    这个真的可以了,已经达到我想要的效果了,谢谢谢谢我的storyboard里的关系是
    TabBarController1----TabBarController2-----ViewControler21
                                                                     -----ViewController22
                                 ------ViewController11我是想设置TabBarController2的TabBar到顶部,然后把其中的View扩展的下部
    我在ViewControler21 里 设置self.view的frame没有效果
    但是在ViewControler21 里 按照如下设置就又效果了
    UIView *contentView;
        if ( [[self.tabBarController.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]] )
            contentView = [self.tabBarController.view.subviews objectAtIndex:1];
        else
            contentView = [self.tabBarController.view.subviews objectAtIndex:0];
        contentView.frame = CGRectMake(contentView.bounds.origin.x,  contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height + self.tabBarController.tabBar.frame.size.height);我有点晕了,这里的view的层级好像很复杂啊,请问有没有清晰一点的层级结构图啊
    你自己写的代码你还不清楚你上面的层次图????建议看看关于图层和uiview的继承,uikit框架
      

  16.   


    我在viewDidLoad 里面设置 view的frame,没有任何效果,然后我在view的重载函数setFrame里打印发现,它在我设置之后还会被系统调用很多次,就是说,我的设置在前,系统设置在后,又把view的位置设置回去了,我到底要在哪里设置它的位置比较好啊

    你最后一个pic显示你那view上有2个tabbar的占位  这种情况,最好不要全部都用tabbar,你考研用一个tabbat+分段按钮这个方法好像也可以,但是上下两个tabbar的场合应该也有把http://www.gowhich.com/blog/172  这个是隐藏tabbaar的。tabbar在顶部,就需要设置view。frame
     contentView.frame = CGRectMake(contentView.bounds.origin.x,  contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height + self.tabBarController.tabBar.frame.size.height);    这个真的可以了,已经达到我想要的效果了,谢谢谢谢我的storyboard里的关系是
    TabBarController1----TabBarController2-----ViewControler21
                                                                     -----ViewController22
                                 ------ViewController11我是想设置TabBarController2的TabBar到顶部,然后把其中的View扩展的下部
    我在ViewControler21 里 设置self.view的frame没有效果
    但是在ViewControler21 里 按照如下设置就又效果了
    UIView *contentView;
        if ( [[self.tabBarController.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]] )
            contentView = [self.tabBarController.view.subviews objectAtIndex:1];
        else
            contentView = [self.tabBarController.view.subviews objectAtIndex:0];
        contentView.frame = CGRectMake(contentView.bounds.origin.x,  contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height + self.tabBarController.tabBar.frame.size.height);我有点晕了,这里的view的层级好像很复杂啊,请问有没有清晰一点的层级结构图啊
    你自己写的代码你还不清楚你上面的层次图????建议看看关于图层和uiview的继承,uikit框架mac和xcode刚刚使用5天,很多都很晕的
      

  17.   


    我在viewDidLoad 里面设置 view的frame,没有任何效果,然后我在view的重载函数setFrame里打印发现,它在我设置之后还会被系统调用很多次,就是说,我的设置在前,系统设置在后,又把view的位置设置回去了,我到底要在哪里设置它的位置比较好啊

    你最后一个pic显示你那view上有2个tabbar的占位  这种情况,最好不要全部都用tabbar,你考研用一个tabbat+分段按钮这个方法好像也可以,但是上下两个tabbar的场合应该也有把http://www.gowhich.com/blog/172  这个是隐藏tabbaar的。tabbar在顶部,就需要设置view。frame
     contentView.frame = CGRectMake(contentView.bounds.origin.x,  contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height + self.tabBarController.tabBar.frame.size.height);    这个真的可以了,已经达到我想要的效果了,谢谢谢谢我的storyboard里的关系是
    TabBarController1----TabBarController2-----ViewControler21
                                                                     -----ViewController22
                                 ------ViewController11我是想设置TabBarController2的TabBar到顶部,然后把其中的View扩展的下部
    我在ViewControler21 里 设置self.view的frame没有效果
    但是在ViewControler21 里 按照如下设置就又效果了
    UIView *contentView;
        if ( [[self.tabBarController.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]] )
            contentView = [self.tabBarController.view.subviews objectAtIndex:1];
        else
            contentView = [self.tabBarController.view.subviews objectAtIndex:0];
        contentView.frame = CGRectMake(contentView.bounds.origin.x,  contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height + self.tabBarController.tabBar.frame.size.height);我有点晕了,这里的view的层级好像很复杂啊,请问有没有清晰一点的层级结构图啊
    你自己写的代码你还不清楚你上面的层次图????建议看看关于图层和uiview的继承,uikit框架mac和xcode刚刚使用5天,很多都很晕的
    5天???好吧,你很牛逼了,,我刚接触mac5天的时候连属性都弄不清楚。。
    加油吧,你会变得很强的
      

  18.   


    我在viewDidLoad 里面设置 view的frame,没有任何效果,然后我在view的重载函数setFrame里打印发现,它在我设置之后还会被系统调用很多次,就是说,我的设置在前,系统设置在后,又把view的位置设置回去了,我到底要在哪里设置它的位置比较好啊

    你最后一个pic显示你那view上有2个tabbar的占位  这种情况,最好不要全部都用tabbar,你考研用一个tabbat+分段按钮这个方法好像也可以,但是上下两个tabbar的场合应该也有把http://www.gowhich.com/blog/172  这个是隐藏tabbaar的。tabbar在顶部,就需要设置view。frame
     contentView.frame = CGRectMake(contentView.bounds.origin.x,  contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height + self.tabBarController.tabBar.frame.size.height);    这个真的可以了,已经达到我想要的效果了,谢谢谢谢我的storyboard里的关系是
    TabBarController1----TabBarController2-----ViewControler21
                                                                     -----ViewController22
                                 ------ViewController11我是想设置TabBarController2的TabBar到顶部,然后把其中的View扩展的下部
    我在ViewControler21 里 设置self.view的frame没有效果
    但是在ViewControler21 里 按照如下设置就又效果了
    UIView *contentView;
        if ( [[self.tabBarController.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]] )
            contentView = [self.tabBarController.view.subviews objectAtIndex:1];
        else
            contentView = [self.tabBarController.view.subviews objectAtIndex:0];
        contentView.frame = CGRectMake(contentView.bounds.origin.x,  contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height + self.tabBarController.tabBar.frame.size.height);我有点晕了,这里的view的层级好像很复杂啊,请问有没有清晰一点的层级结构图啊
    你自己写的代码你还不清楚你上面的层次图????建议看看关于图层和uiview的继承,uikit框架mac和xcode刚刚使用5天,很多都很晕的
    5天???好吧,你很牛逼了,,我刚接触mac5天的时候连属性都弄不清楚。。
    加油吧,你会变得很强的
    谢谢鼓励,我会努力的,可否关注一下我,谢谢