ios - Fit image to top of screen, fill width, keep aspect ratio -
so, i'm trying have "banner" @ top of viewcontroller. need image stay @ top of screen, full width of screen , keep aspect ration when doing so. i'm having hard time doing this. here tried:
- putting constraints on top, left , right of image view.
- make mode
aspect fit
but how turns out:
anyone have idea how can force banner top , make keep aspect ratio well?
the problem still lack constraint. can add constraint such height, or aspect ratio. however, when add constraint aspect ratio, fill whole screen when in landscape. unless, you're using portrait, aspect ratio fine. if you're both using portrait , landscape, can use height constraint, , set content mode of image view aspect fit.
Comments
Post a Comment