4

How can I make sure that AutoLayout is not used for one of my UIViewControllers?
The view controller is created fully from code, without a nib file.

I found many posts to about disabling auto layout in nib file, but not any about disabling it from code

The problem I have is that in my MkMapView I have an annotation (an arrow) which does not correctly rotate like in ios5. In ios6 somehow the rotation is set to 0 degrees, immediately after it was correctly rotated for a tenth of a second. So the arrow direction flickers in simulator and on device it does not flicker but the rotation is wrong.

AlexWien
  • 28,470
  • 6
  • 53
  • 83
  • 2
    As far as I'm aware, you have to explicitly add the constraints if you make it in code, so by default it won't use AutoLayout. Could be wrong though. Have you tested? – Dave Jun 07 '13 at 22:23
  • I have problems with animating a MkMapAnnotation on ios6. It works on ios5. I have heard that autolayout on ios6 may interfere with animations. So I want to be sure that it is not enabled. – AlexWien Jun 07 '13 at 22:24
  • Ok, i too asume it is not enabled, must be another cause – AlexWien Jun 07 '13 at 22:26
  • Well, if it helps, a quick search found this answer: http://stackoverflow.com/a/15242064/1180785 Which claims to do what you're asking, but I wouldn't be hopeful it will fix your problem. – Dave Jun 07 '13 at 22:27
  • @Dave The post describes to disable it for a specific sub view of a xib . – AlexWien Jun 07 '13 at 22:31
  • 2
    How the view was made doesn't matter. The important bit seems to be the call to `setTranslatesAutoresizingMaskIntoConstraints:YES` – Dave Jun 07 '13 at 22:37
  • Even after this, some complaints regarding broken constraints are thrown by the compiler. If autolayout doesn't work well with something, they should allow us to disable it gracefully and continue with the autoresizing mask. – esh Mar 27 '14 at 07:30

0 Answers0