1
3

More than 3 years have passed since last update.

#11 Xcodeで画像を貼り付ける1例

Last updated at Posted at 2019-11-21

はじめに

個人のメモ程度の出来なのであまり参考にしないで下さい.

環境

Xcode:11.2.1
Swift:5.1.2
2019/11

part1

XcodeでImage Viewと検索して,Viewに乗せる.

スクリーンショット 2019-11-21 午後11.04.44.png

part2

必要な制約を付ける.
Width=120,Height=120,センターに配置.

スクリーンショット 2019-11-21 午後11.06.09.png

part3

XcodeでAssets.xcassetsに画像をドラッグ・ドロップ

スクリーンショット 2019-11-21 午後11.07.22.png

part4

UIImageViewを選択した状態で,Attributes inspectorImageを先ほどAssets.xcassetsにドラッグ・ドロップした画像を選択する.

スクリーンショット 2019-11-21 午後11.07.53.png

part5

UIImageViewを選択した状態で,Attributes inspectorAlphaも任意に設定する.

スクリーンショット 2019-11-21 午後11.08.24.png

part6

ビルドして画像が表示されたらOK.

スクリーンショット 2019-11-21 午後11.16.44.png

1
3
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
1
3