官术网_书友最值得收藏!

  • iOS Programming Cookbook
  • Hossam Ghareeb
  • 241字
  • 2021-07-09 18:29:48

Getting ready

In this recipe, we will see how to build an iOS app which uses a navigation controller. We will see how to push and pop between the view controllers of the navigation controller. We will discuss the navigation bar, which you can see at the top of the navigation controller, and how to customize it.

There is some information that you should know about UINavigationController:

  • The view controllers that it manages are put in a stack; when you push a view controller, you put it at the top of the stack. Also, when you pop a view controller, you remove the top one from the stack and display the preceding one.
  • UINavigationController has three main items--the left item, middle item, and right item.
    • Left Item: By default, you will see a back button (except for the root), and its title is set to the title property of the preceding view controller. You can add a custom button in the by setting leftBarButtonItem or leftBarButtonItems properties in the navigation item of the displayed view controller.
    • Middle Item: By default, a label with the current view controller title property is displayed. You can add custom middle view by setting the titleView property in the navigation item of the displayed view controller.
    • Right Item: This is the same as left item; but by default, there is nothing to display. You can use the rightBarButtonItem or rightBarButtonItems properties in the navigation item.
主站蜘蛛池模板: 安龙县| 青阳县| 彭阳县| 茶陵县| 呈贡县| 朝阳市| 荣昌县| 阿拉善盟| 南宫市| 斗六市| 忻城县| 湖口县| 台中县| 寿宁县| 平罗县| 山西省| 南华县| 开平市| 泽州县| 贡嘎县| 维西| 宁安市| 阜南县| 丰原市| 麻栗坡县| 措勤县| 礼泉县| 出国| 临漳县| 衡阳市| 清镇市| 博白县| 五寨县| 资兴市| 封丘县| 罗平县| 神木县| 偃师市| 贵港市| 冷水江市| 淮南市|