0

I have the following screen: enter image description here

If one clicks on Go Pro and buys the in app, then I'd like to remove the ads from the screen and then have both circle buttons to go to very bottom of the screen.

One possibility I thought was to have a horizontal stack view to hold the three buttons and a vertical stack view, that would first hold the horizontal stack view and then the Ads View.

Is this solution the best one or there are smarter ones?

Thanks.

UPDATE:

Here's what's happening now: With Vertical Spacing constraint to only one button: enter image description here

With Vertical Spacing constraint to both buttons enter image description here

Bhavin Bhadani
  • 22,224
  • 10
  • 78
  • 108
Felipe Caldas
  • 2,492
  • 3
  • 36
  • 55
  • 1
    just give height constraint to that admob view and make outlet and when you remove it set its constraint to 0 – Bhavin Bhadani Jun 03 '16 at 13:12
  • 1
    you can check this ... http://stackoverflow.com/questions/32804655/changing-constraints-at-runtime-in-swift/32804873 and if you are using iOS 9.0 and above stackview is good to use – Bhavin Bhadani Jun 03 '16 at 13:18
  • Hey, thanks for the reply! I don't think I understood it though. My AdsMob view has a height constraint of 50. Are you saying that I need to get the height constraint of Admob as an Outlet and set its constant to zero? – Felipe Caldas Jun 03 '16 at 13:31
  • Alright, thank you. How do I find the height constraint of my AdView UIView Outlet? The line "adsUIView.constraints" returns a [NSLayoutConstraint]. How do I find the height one? – Felipe Caldas Jun 03 '16 at 13:37
  • in storyboard ... document outline ... check this how to make outlet of constraint http://stackoverflow.com/questions/31356293/uitableview-and-uiview-with-keyboardwillshow/31356527#31356527 – Bhavin Bhadani Jun 03 '16 at 13:39
  • Oh, I didnt know you could turn a constraint an outlet! Thanks! Let me try this now – Felipe Caldas Jun 03 '16 at 13:39
  • Ok, by setting the constant to zero, the Ads View disappeared. All good. But the buttons did not go to the bottom of the screen. Do they need any constraint to do so? – Felipe Caldas Jun 03 '16 at 13:41
  • 1
    Oh, I see. It's almost there, but not quite. I will keep trying and let you know. Thanks a bunch! – Felipe Caldas Jun 03 '16 at 13:46
  • Thanks El Captain. What is happening now is that the bottom part of the button is stretching all the way down to the bottom part of the screen. But the top part stays in the original location, so the button is stretching out. Should I programatically update the constraint that configures the top part of the button ? – Felipe Caldas Jun 03 '16 at 13:51
  • I just added two new screenshots to illustrate the new issue. Thanks – Felipe Caldas Jun 03 '16 at 13:55

1 Answers1

1

If you are using iOS 9.0 and above, you can use stackview else make outlet of height constraint of bottom view and set to 0 on close ad mob.

For the other issue i.e button stretch .. add one view that contains that 3 buttons and add constraints to that view ... just check below image and give constraints...

enter image description here

Now on close admob, just set constant of height constraint to 0.

enter image description here

and the result will be

enter image description here

Bhavin Bhadani
  • 22,224
  • 10
  • 78
  • 108