iT邦幫忙

第 12 屆 iThome 鐵人賽

DAY 20
0
Mobile Development

IOS 基本元件運用和套件運用系列 第 20

(Day20)Swift UI Image View

在iOS UI Image View 是用來顯示圖片的元件。他能自動的調整圖片大小來適應當前的UI Image View 的大小。

用Storyboard添加UI Image View元件

點擊右上角的“+”符號,在搜索欄搜尋Image View
https://ithelp.ithome.com.tw/upload/images/20201003/201296780oq5yef0Px.png

右鍵按著拖到 storyboard
https://ithelp.ithome.com.tw/upload/images/20201003/20129678eECGMYAiyf.png

功能

添加圖片

把要顯示的圖片添加到Assets.xcassets文件夾
https://ithelp.ithome.com.tw/upload/images/20201003/20129678bWXwUys3QX.png

這時候就可以在選擇圖片了
https://ithelp.ithome.com.tw/upload/images/20201003/20129678PHxmQSecJY.png

完成!
https://ithelp.ithome.com.tw/upload/images/20201003/20129678XCHO489jpK.png


上一篇
(Day19)Date Picker 元件
下一篇
(Day21)Slider元件
系列文
IOS 基本元件運用和套件運用30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言