title: How to hide inputAccessoryView without dismissing keyboard
body: <p>I am using a toolbar in the inputAccessoryView property of a textView. When the keyboard shows, it displays the toolbar as expected. When the device is rotated I want to remove the toolbar. I tried:</p>
  
  <pre><code> myTextView.inputAccessoryView.hidden = !layoutIsPortrait;
  </code></pre>
  
  <p>This does hide the toolbar, but leaves the outline of the taller keyboard behind. The keyboard is apparently still sized to fit the toolbar. It looks bad and interferes with touch events of underlying responders.</p>
  
  <pre><code> myTextView.inputAccessoryView = nil;
  </code></pre>
  
  <p>Works only if I resignFirstResponder, then becomeFirstResponder again. This is not acceptable. I lose the cursor placement and content of the textView, keyboard flashes out and back.</p>
  
  <pre><code>[myTextView.inputAccessoryView removefromSuperview];
  </code></pre>
  
  <p>Does nothing at all.
  I saved a reference to the toolbar in a iVar and addressed that instead,</p>
  
  <pre><code>[myIvarReference removeFromSuperview];
  </code></pre>
  
  <p>That works, but again the taller outline of the keyboard is faintly visible. This time it does not interfere with touches of other views. So now this is a working solution but visually unacceptable.
  What else can I try to show and hide the inputAccessoryView at will?</p>
  
  <p>Screenshot- the faint line above the keyboard is remnant of the removed toolbar</p>
  
  <p><img src="https://i.stack.imgur.com/4x7dl.jpg" alt="Rotated keyboard with toolbar removed"></p>