I am using a UIButton
for navigation item title view
, and the width of the button is subject to change, so I'm setting the frame like below:
CGFloat titleButtonTextWidth = [title sizeWithAttributes:@{NSFontAttributeName:FontMedium(14)}].width;
CGFloat buttonWidth = MAX(titleButtonTextWidth, SCREEN_WIDTH/3.f);
self.titleButton.frame = CGRectMake(0, 0, buttonWidth, 30);
On iPhone 5s and lower, the title button stays at the middle, but for iPhone 6 and up, the origin
of the frame
is respected and the title button ends up in the top-left corner. Solving this is easy, but I don't know why Apple decided to suddenly change things like this.
Do you guys think this might be a bug or a change?