Search code examples
iosxcodeautolayoutstoryboard

position an element with respect to a particular point of an image in storyboard


What I want to do is position an element (a coloured UIView that I use as a background) to my storyboard so that it starts at the middle of an ImageField and fills everything till the bottom of the screen. I'm using xcode7 and swift.


Solution

  • You can align the bottom of your UIView and UIImageView, and keep the height of your UIView as half of that of UIImageView.

    Or if you want the view to go till the bottom, you can do it all in storyboard by adding another view that extends from the bottom of the UIImageView to the bottom of the screen.