open viewcontroller from tab like in instagram camera page on IOS

前端 未结 3 1755
逝去的感伤
逝去的感伤 2020-12-10 00:17

what i want is suppose to be simple, instagram middle tab on IOS opens the app\'s camera interface but not like the rest of the tabs but as an independet view controller and

3条回答
  •  遥遥无期
    2020-12-10 00:35

    Sounds like what you're trying to do involves a TabBarViewController. You can start a project off by choosing this option from the Xcode welcome screen to create a new project:

    enter image description here

    enter image description here

    This "Tabbed Application" starter project will give you a fully functional and running app you can build from.

    The way you're describing the tab bar controller in Instagram sounds like you'll have to do a couple customizations to your tab bar controller. First, the camera tab in the middle has a blue background. Try this SO article to help with that.

    When you hit the cancel button on the camera page and you want the last selected tab to be selected use this method as a starting place to programatically select a certain tab:

    [self.tabBarController setSelectedIndex:2];
    

    Hope this gets you started in the right direction.

提交回复
热议问题