iosswiftuitoolbaruitoolbaritem

Image size shown big in toolbar


I have set 3 images on a toolbar. It looks like so...

enter image description here

Here I added a toolbar, added barbutton items and set images to those buttons. The image type is 1x,2x,3x format and is rendered asa default image.

But the images shown above are shown large while it should have been small given like so...

What have I done wrong..?

enter image description here

EDIT 1: Screenshot of UI layout

enter image description here


Solution

  • Your image resolution must be like below

    enter image description here

    Tool bar structure

    enter image description here

    Use barbutton not button

    enter image description here


    I tested it, its work properly

    Output

    enter image description here