Rework conversation view header.

// FREEBIE
This commit is contained in:
Matthew Chen 2017-09-07 10:47:35 -04:00
parent b626fb5bf8
commit 26a6e76f3c
1 changed files with 11 additions and 4 deletions

View File

@ -1354,10 +1354,17 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
}
CGSize screenSize = [UIScreen mainScreen].bounds.size;
CGFloat screenWidth = MIN(screenSize.width, screenSize.height);
// Request "full width" title; the navigation bar will truncate this
// to fit between the left and right buttons.
self.navigationBarTitleView.frame = CGRectMake(0, 0, screenWidth, 44);
self.navigationItem.titleView = self.navigationBarTitleView;
if (self.navigationItem.titleView != self.navigationBarTitleView) {
// Request "full width" title; the navigation bar will truncate this
// to fit between the left and right buttons.
self.navigationBarTitleView.frame = CGRectMake(0, 0, screenWidth, 44);
self.navigationItem.titleView = self.navigationBarTitleView;
} else {
// Don't reset the frame of the navigationBarTitleView every time
// this method is called or we'll gave bad frames where it will appear
// in the wrong position.
[self.navigationBarTitleView layoutSubviews];
}
if (self.userLeftGroup) {
self.navigationItem.rightBarButtonItems = @[];