ios - Resizing a toolbar on rotate in iOS8 -


When I iPhones / iPod rotate so I'm trying to get the toolbar at the bottom of your app. The Navigation Controller automatically resizes the navigation bar in iOS8. It achieves the right height if this activity is already in the scenario, when the activity has started.

As the picture of the same size it is rotated into landscape Now

small because the activity began in Landscape to

Toolbar storyboard were added.

  @Iboutlet var Toolbar: UIToolbar!  

I willRotateToInterfaceOrientation (toInterfaceOrientation: UIInterfaceOrientation, period: NSTimeInterval) in the toolbar to try to change the reset

In this way :

  override funk to Arotettointrfesorenteshn (interface Orianteshn: Uaiantiffaid orientation period: Anstiiiinintrvl) {var custom Tulbarfrem: Sijiarakt! If toInterfaceOrientation == UIInterfaceOrientation.Portrait {customToolbarFrame = CGRectMake (0, self.view.bounds.size.height - 44, self.toolbar.frame.size.width, 44)} of {customToolbarFrame = CGRectMake (0, self.view .bounds.size.height - 32, self.toolbar.frame.size.width, 32)} UIView.animateWithDuration (duration, animation: {self.toolbar.frame = customToolbarFrame}}}  
< P <> I also tried without animation, but no luck.

This works if I do this from didRotateFromInterfaceOrientation (InterfaceOrientation: UIInterfaceOrientation) but the animation Without it it looks awful because there is some delay.

Solution

to c

  1. I have selected w for any iPhone, any compact selected
  2. set the 32px height at intervals and update the frame items

: If you are using the layout, you can set different high barriers in the picture and landscape, for example, wCompact. Add 32 high impedance to Toolbar in hCompact mode, you will be able to see a 32 height toolbar in landscape mode, this is a


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -