UINavigationItem titleView position

前端 未结 7 770
长发绾君心
长发绾君心 2021-02-13 03:45

I\'m using UINavigationItem\'s titleView property to set a custom UILabel with my desired font size/color. Here\'s my code:

self.headerLabel = [[UILabel alloc] i         


        
7条回答
  •  余生分开走
    2021-02-13 03:59

    If you make the headerLabel a subview of the titleView, you can then set headerLabel's frame to control where it goes within the titleView.

    The way you are doing it now, you don't have that control. I think the OS chooses the titleView's frame for you based on the space available.

    Hope this helps!

提交回复
热议问题