4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

画像の比率を崩さずUIImageViewに表示させる

Last updated at Posted at 2015-10-15

条件

・表示したい画像の縦横比が異なる。

やりたいこと

・UIImageViewで表示する際には正方形にしたい。
・比率を崩さずはみ出した分は切り抜いて表示したい。

方法

Interface Builderで対象のUIImageViewを選択し、Attributeインスペクタで「Mode > Aspect Fill」を選択「Drawing > Clip Subviews」をチェック」

(Xcode7で実施)

4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?