TabBarItems and setting their image sizes?

后端 未结 4 390
清酒与你
清酒与你 2020-11-29 19:00

I am currently adding images to each one of my tab bar items. One image I like has a size that is much bigger then the area of the bar item. When I set the image of the bar

4条回答
  •  萌比男神i
    2020-11-29 19:25

    @LeoDabus provided a good answer.

    For resizing the image, a good and easy way to do this is to:

    1. Add your image to the 1x, 2x, 3x boxes in Assets.xcassets folder.
    2. Then, click on the image in each box and double-finger tap the trackpad/right-click which will reveal the options here:

    1. Click on 'Open with External Editor', which will bring you to Preview.
    2. Click on 'Tools' then 'Adjust Size'.

    1. Adjust the size of your image based on your requirements. Then hit 'Save' and close the window. The image in Xcode should be auto-updated.

提交回复
热议问题