Setting the “title” of a UIPopoverController?

后端 未结 2 378
野性不改
野性不改 2020-12-30 00:32

I\'m sure there\'s something obvious I\'m missing here, but I know that popover controls can have \"titles\", a header area that has a line of text above the content view (e

相关标签:
2条回答
  • 2020-12-30 01:10

    I have been beating my head against the wall all day with the same problem and I think I finally have the solution :D You need to use a UINavigationController for the popover's contentViewController, and then add a title to the navigations controller's navigation bar, like you normally would. Oddly, this doesn't work if you add a navigation bar to your existing view controller.

    0 讨论(0)
  • 2020-12-30 01:24

    If you're using a UIPopoverController, just make its contentViewController to be a UINavigationController, and set the title of its deepest view controller.

    If you're using a UIActionSheet, it has a title property already (which you should notice when initializing with -initWithTitle:….)

    0 讨论(0)
提交回复
热议问题