Adding autolayout constraints to navigation controller programmatically

前端 未结 3 971
闹比i
闹比i 2020-12-21 03:50

I am trying to add constraints to a UI label I added on a navigation bar. The UI label shows a running timer

Here is my code,

self.label = [[UILabel          


        
3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-21 04:38

    Another way, after adding your custom view as a subview to UINavigationBar, manually setup position and size with an old fashion way by updating .frame property. It isn't a "flexible" solution, but simple and fast.

提交回复
热议问题