What are the correct dimensions for a custom tab bar item background image?

后端 未结 6 683
北海茫月
北海茫月 2021-01-13 15:11

So I have a .png that\'s 428x176 px:

I want to use it as a tab bar background image for when an item is in the selected state. The problem is t

6条回答
  •  再見小時候
    2021-01-13 15:40

    There's no clear cut answer for this as the tab bar itself isn't of fixed size on various iOS versions and various iOS devices.

    Starting iOS 11, tab bar will have smaller height and titles will move to right in landscape mode.

    So the idea is to have a stretchable image that can be stretched along all all edges - top/leading/bottom/trailing.

    For your reference - http://macoscope.com/blog/stretchable-images-using-interface-builder/

    Here are few images from above blog post to help make it clear -

    Hope this helps.

提交回复
热议问题