0

I am newbie in storyboards and auto layouts/constraints. I have to show one of three different views and some times full three views in widget todays extension iOS8 at specific time and I am using IBOutlets and storyboard with auto layout and constraints because it is universal build. Once I hide the specific view it will leave empty space in others views as I came to know that constraints are still there so it is.... but I have tried to remove the view from superview and set

self.exampleView.translatesAutoresizingMaskIntoConstraints = YES;

but all in vain

full view : scenario :1

next scenario:

enter image description here

I hope i get out of this !

Kampai
  • 22,848
  • 21
  • 95
  • 95
  • 1
    set your `translatesAutoresizingMaskIntoConstraints` to `NO`. Do you call `[view setNeedsLayout]`? – Crazyrems Dec 22 '14 at 13:11
  • I have view1 , view2 , view3 and doing like this // _view2.translatesAutoresizingMaskIntoConstraints = NO; _view2.hidden = YES; [_view2 setNeedsLayout]; like this you mean ? @Crazyrems – Mian Muhammad Umair Liaqat Dec 22 '14 at 13:16
  • The `translatesAutoresizingMaskIntoConstraints` may be what you want, but it creates supplementary constraints at runtime _(which may be undesirable)_. `setNeedsLayout` forces to layout before the next draw operation. So, yes it's probably what you must do. If you don't see any changes, try to create more/different/change your constraint priorities to the needs of your layout. I'm looking for a way to do what you want. – Crazyrems Dec 22 '14 at 13:26

0 Answers0