iOS 7 Custom UINavigationBar TitleView moves when Pushing or Popping new View Controller

后端 未结 7 1124
谎友^
谎友^ 2020-12-18 18:26

I am using a custom title view for a UINavigationBar with the following code:

// Set a label to the nav bar
THLabel *titleLabel = [[THLabel alloc] init];
tit         


        
7条回答
  •  生来不讨喜
    2020-12-18 18:44

    I would embed the label inside a UIView. Interface Builder doesn't like putting directly a UILabel in the titleView for some reason that may be related to your problem.

    Also try to set the autoResizingMask to UIViewAutoresizingFlexibleTopMargin. In my experience any custom view in bars behaves better this way.

提交回复
热议问题