0

I have been using a UIView in my navigationBar as the titleView up to Xcode 8 iOS 10. The view was added in storyboard. In that UIView I have a label representing the title and underneath it a segmented control. This has worked fine up until iOS 11. Now I can no longer interact with the segmented control and the positioning is shifting up so that the title and half of the segmented control is off screen. I was using an empty space for the prompt field of the navigationBar to get the extra height.

Is there a way of adding a title and segmentedControl underneath it to a navigationBar without creating a custom navigationBar? I don't want to create a custom navigationBar because I want to keep the translucency properties of the default navigationBar.

At the moment here is what I see after running Xcode 9 iOS 11:

enter image description here

alionthego
  • 8,508
  • 9
  • 52
  • 125

2 Answers2

0

Add in Appdelegate.m

if ([UIScreen mainScreen].bounds.size.height >= 812)
 {
   [application setStatusBarStyle:UIStatusBarStyleLightContent];
   self.window.clipsToBounds =YES;
   self.window.frame = CGRectMake(0,40,self.window.frame.size.width,self.window.frame.size.height-20);
 }
  • I think this code is objective c but the question has swift 4 tag plus this might include iPad as well – zombie Sep 20 '17 at 18:19
0

Best way to manage this is to add the segmentedControl directly in the navigationTitle area in the storyboard and afterwards add a title in the inspector title textfield in storyboard when navigationBar is selected. This will show both the title in large font and the storyboard above it exactly like the missed calls page of iOS

alionthego
  • 8,508
  • 9
  • 52
  • 125