4

I have one button, i set it's constraints to "Horizontal centre" and "Vertical centre". It is appearing in centre as expected in portrait mode. But the moment when i rotate the device to landscape mode, the button disappears and status bar also not visible.

Rakesh
  • 1,177
  • 1
  • 15
  • 31
  • first in iOS8 status bar is not visible in landscape mode, so that's not a problem, second remove all constraint and then try again, may be it other constrain which are causing the problem. – Jageen Dec 04 '14 at 10:34
  • give detail description under which environment you are developing application. – Jageen Dec 04 '14 at 10:36

3 Answers3

0

have you fixed the height and width of the UIButton? if not add height and width constraints to the UIButton

Anbu.Karthik
  • 82,064
  • 23
  • 174
  • 143
0

Here is a screen which show constraint needed to show button in centre in both landscape and portrait mdoe enter image description here

This is a simplest thing i ever post in stackoverflow
Please check your code again and see is there any other constrains you had apply.


Note : In iOS8 status bar is hide in landscape mode and if you want to display it in landscape mode please follow my answer over here link.
Community
  • 1
  • 1
Jageen
  • 6,345
  • 2
  • 37
  • 56
0

Check the size class for which you set the constraints. If you are not aware of size classes watch the wwdc 2014 video titled "Building Adaptive Apps with UIKit".

Varoon
  • 172
  • 1
  • 5