Apple Mail app in thread views has a dynamic, taller than usual navigation bar which collapses when you scroll. Is it possible to achieve same effect using only allowed API calls or is this available only internally for Apple?
Asked
Active
Viewed 284 times
1
-
1Did you set `prefersLargeTitles = YES` ? – koen Apr 13 '18 at 15:23
2 Answers
0
Please check here. The link has different ways to solve the problem. However following code helped me.
for subview in (self.navigationController?.navigationBar.subviews)! {
if NSStringFromClass(subview.classForCoder).contains("BarBackground") {
var subViewFrame: CGRect = subview.frame
// subViewFrame.origin.y = -20;
subViewFrame.size.height = 100
subview.frame = subViewFrame
}
}

Pratik
- 676
- 10
- 9
0
You can able to set it as follows
-(void)layoutSubviews{
[super layoutSubviews];
CGRect rectStatus = [[UIApplication sharedApplication] statusBarFrame];
if (rectStatus.size.height==44.f) {
}else{
if (@available(iOS 11.0, *)) {
for ( UIView*aView in self.subviews) {
if ([NSStringFromClass(aView.classForCoder) isEqualToString:@"_UINavigationBarContentView"]) {
aView.frame = CGRectMake( 0,20,aView.frame.size.width,44);
}
else if ([NSStringFromClass(aView.classForCoder) isEqualToString:@"_UIBarBackground"]) {
aView.frame = CGRectMake(0,0,aView.frame.size.width, 64);
}
}
}
}
}

casillas
- 16,351
- 19
- 115
- 215