UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Project 2: how to adjust custom high res image size to button? its too big(screenshots attached)

Forums > 100 Days of Swift

Hi, i used the highest resolution from https://github.com/hampusborgos/country-flags , 1000 pixels but the image is too big when i assign it to the button under Project 2. I want to create a game for all country flags and tried figuring out a couple hours how to fit image within the button but to no avail.

Anyone can help how xcode can auto-resize to fit within the button size? attached 3 screenshots below

https://drive.google.com/file/d/1ZrvFoYM18AbZGeRLY_42sshXXBtUAUgo/view

https://drive.google.com/file/d/1WvMzrkVw172Tou25m9nILbqffAZfSu6L/view?usp=sharing

https://drive.google.com/file/d/1vfaLfI8nKl4Bmk_1MMWYXX5fWpheMiZe/view?usp=sharing

https://drive.google.com/file/d/1m2Zq0xRoGPvO59ZXlDHvTya1cHcs0iji/view?usp=sharing

3      

well, i think for buttons, the .png files do not automatically resize to the button size, unlike for image View.

i had to reduce the .png imagesize down to 150 pixels in order to fit within the button sizes

3      

Hacking with Swift is sponsored by Essential Developer

SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until April 28th.

Click to save your free spot now

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.