iOS UINavigationBar vs UIToolbar vs UITabBar

前端 未结 4 1034
梦谈多话
梦谈多话 2021-02-02 11:22

Let me know which one should be used in what case.

What are differences among them?

What are the advantage and disadvantage of each component?

4条回答
  •  半阙折子戏
    2021-02-02 11:39

    As of June 2018, the Human Interface Guidelines (HIG) include the most current expectations for iOS, macOS, watchOS, and tvOS, including links to details for developers.

    For iOS, the guideline summaries are:

    Navigation Bars:

    A navigation bar appears at the top of an app screen, below the status bar, and enables navigation through a series of hierarchical screens.

    Toolbars:

    A toolbar appears at the bottom of an app screen and contains buttons for performing actions relevant to the current view or content within it.

    Tab Bars:

    A tab bar appears at the bottom of an app screen and provides the ability to quickly switch between different sections of an app.

    As far as advantages and disadvantages of each, one important aspect is whether you want the bar to appear at the top or bottom of a view. Navigation bars are supposed to appear at the top, while toolbars and tab bars are expected to appear at the bottom of the view.

    Another is whether you want navigation functionality vs actions/tasks related to a view. Navigation Bars implement a button to return to the previous view in the stack, tab bars provide a more abrupt change (such as switching from an alarm view to a timer view, say), and toolbars are really intended for actions (such as sharing, say) rather than actual "navigation".


    Note:
    If you come here and find that any of the links are broken, just search on "Human Interface Guidelines" to find the current documentation.

提交回复
热议问题