iOS How to force resize UINavigationBar's title label in width -
i'm looking way forcefulness resize navigation bar's title label nowadays whole title string ("title" instead of "tit..."). have thought how it? reason want it, have double navigation bar (2x height) buttons in upper half , title below them. problem is, title label gets shrinked in width prevent overlapping buttons if on same height.
after time , learning i've found solution, i'm posting in case encounters same problem.
you have overwrite navigations bar's layoutsubviews
method this:
- (void)layoutsubviews { [super layoutsubviews]; cgrect currentframe = self.topitem.titleview.frame; self.topitem.titleview.frame = cgrectmake(0, currentframe.origin.y, [uiscreen mainscreen].bounds.size.width, currentframe.size.height); }
it create title label take total screen width, can alter values of frame size suit needs.
ios uinavigationbar
No comments:
Post a Comment