Swift-How do I add Tab Bar AND Navigation Bar to a single view controller?

前端 未结 2 984
长情又很酷
长情又很酷 2020-12-13 10:05

Using XCode, and either through Code or through the Storyboard, can someone please explain to me how to add both a Tab Bar and Nav Bar to my view controller while keeping bo

2条回答
  •  臣服心动
    2020-12-13 10:22

    screenshot

    I am assuming you want something like this. Here is how I did it in Interface Builder:

    1. Click your view controller.
    2. Editor -> Embed In -> Navigation Controller
    3. Reselect your view controller.
    4. Editor -> Embed In -> Tab Bar Controller
    5. Select the Navigation Controller
    6. Check the box next to Is Initial View Controller

    Hope this helps!

提交回复
热议问题