swift #013 practice-讓button圖片變成圓形並維持比例

堅定方向,不隨波逐流

step 1. Objects Library 點選+

step 2. 加入button

step 3. 設定Background Configuration的欄位

3.1 將button的Title文字去除

3.2 將Background設為Custom

3.3 選擇Image圖片

3.4 將Content Mode設為Aspect Fill,此設定可以讓圖片維持比例並填滿整個button

3.5 當button圖片大小為正方形時,可以設定Corner Style,設定為Capsule則可以變成圓形

參考資料

--

--