Note that there are some explanatory texts on larger screens.

plurals
  1. POStrange behavior of Navigation Bar of Split View Controller
    text
    copied!<p>I found rather odd behavior of <code>UINavigationBar</code> of <code>UISplitViewController</code>. I have a stadard <code>rootViewController</code> on the picture below:</p> <p><img src="https://i.stack.imgur.com/CUFSI.png" alt="enter image description here"></p> <p>When the bar button is pressed(it is temporarily for debug styled as "Add button"), I add a new Navigation bar(NOTE: I add, I do not replace!) that handles events done on screen.</p> <p><strong>Explanation</strong> - the button is pressed and user starts drawing stuff on screen, the new bar is added for interaction to make the drawing mode stop.</p> <p><strong>Problem</strong> - however, when I add this bar a strange graphical detail appears where the bar of my <code>rootViewController</code> is split in two pieces. Picture below(marked red):</p> <p><img src="https://i.stack.imgur.com/bmH4z.png" alt="enter image description here"></p> <p>Is it a known issue or is it there for a reason?</p> <p>CODE:</p> <pre><code>UINavigationBar *tmpBar = [[UINavigationBar alloc] initWithFrame:CGRectOffset(CGRectMake(0.0, 0.0, 1024.0, 44.0), 0, - 44.0)]; UINavigationItem *it = [[UINavigationItem alloc] initWithTitle:@"Draw, baby, draw!"]; it.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancelDrawing)]; it.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(sendMail)]; tmpBar.items = [[NSArray alloc] initWithObjects:it, nil]; self.canvasBar = tmpBar; [self.splitViewController.view addSubview:self.canvasBar]; [self.splitViewController.view bringSubviewToFront:self.canvasBar]; [UIView beginAnimations:@"animateBarOn" context:NULL]; [UIView setAnimationDuration:1.0]; [self.canvasBar setFrame:CGRectOffset([self.canvasBar frame], 0, 44)]; [UIView commitAnimations]; </code></pre> <p><strong>NOTE:</strong> I am not looking for an <em>alternative</em> solution, but for <strong>EXPLANATION</strong> why this is happening.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload