Jacksonkr Jacksonkr - 2 years ago 2189
iOS Question

UIImage aspect fit and align to top

It looks like

aspect fit
aligns the image to the bottom of the frame by default. Is there a way to override the alignment while keeping
aspect fit

Answer Source

In short, you cannot do this with a UIImageView.

One solution is to subclass a UIView containing an UIImageView and change its frame according to image size. For example, you can find one version here.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download