mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-09 09:27:42 +02:00
BugFix: Chat screen: the room title is missing in landscape mode on iPhone 6+
This commit is contained in:
@@ -39,13 +39,28 @@
|
||||
|
||||
if (self.superview)
|
||||
{
|
||||
// Center horizontally the avatar according to the actual screen center
|
||||
// Center horizontally the avatar into the navigation bar
|
||||
CGRect frame = self.superview.frame;
|
||||
CGSize screenSize = [[UIScreen mainScreen] bounds].size;
|
||||
UINavigationBar *navigationBar;
|
||||
UIView *superView = self;
|
||||
while (superView.superview)
|
||||
{
|
||||
if ([superView.superview isKindOfClass:[UINavigationBar class]])
|
||||
{
|
||||
navigationBar = (UINavigationBar*)superView.superview;
|
||||
break;
|
||||
}
|
||||
|
||||
superView = superView.superview;
|
||||
}
|
||||
|
||||
CGFloat superviewCenterX = frame.origin.x + (frame.size.width / 2);
|
||||
|
||||
self.roomAvatarCenterXConstraint.constant = (screenSize.width / 2) - superviewCenterX;
|
||||
if (navigationBar)
|
||||
{
|
||||
CGSize navBarSize = navigationBar.frame.size;
|
||||
CGFloat superviewCenterX = frame.origin.x + (frame.size.width / 2);
|
||||
|
||||
self.roomAvatarCenterXConstraint.constant = (navBarSize.width / 2) - superviewCenterX;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,14 +55,29 @@
|
||||
|
||||
if (self.superview)
|
||||
{
|
||||
// Center horizontally the display name according to the actual screen center
|
||||
// Center horizontally the display name into the navigation bar
|
||||
CGRect frame = self.superview.frame;
|
||||
CGSize screenSize = [[UIScreen mainScreen] bounds].size;
|
||||
UINavigationBar *navigationBar;
|
||||
UIView *superView = self;
|
||||
while (superView.superview)
|
||||
{
|
||||
if ([superView.superview isKindOfClass:[UINavigationBar class]])
|
||||
{
|
||||
navigationBar = (UINavigationBar*)superView.superview;
|
||||
break;
|
||||
}
|
||||
|
||||
superView = superView.superview;
|
||||
}
|
||||
|
||||
CGFloat superviewCenterX = frame.origin.x + (frame.size.width / 2);
|
||||
|
||||
// Center the display name
|
||||
self.displayNameCenterXConstraint.constant = (screenSize.width / 2) - superviewCenterX;
|
||||
if (navigationBar)
|
||||
{
|
||||
CGSize navBarSize = navigationBar.frame.size;
|
||||
CGFloat superviewCenterX = frame.origin.x + (frame.size.width / 2);
|
||||
|
||||
// Center the display name
|
||||
self.displayNameCenterXConstraint.constant = (navBarSize.width / 2) - superviewCenterX;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user