Swift and Xcode - How to Create Custom Tab Bar Icons

后端 未结 4 1940
太阳男子
太阳男子 2021-01-30 11:34

I have a tabbed application project I am working on in Xcode written in Swift (Xcode 6.3 and Swift 1.2). I am having a lot of trouble with custom Tab Bar icons. I

4条回答
  •  一整个雨季
    2021-01-30 11:39

    It sounds like you have everything set up properly in xCode. The problem IS the png file you are using.

    Download this image, http://i.stack.imgur.com/zluev.png , and see if the problem persists.

    According to an answer on UITabBarItem images just appear as a grey block:

    The standard tabbar icons in iOS are rendered solely from the alpha channel. Colors are ignored completely. Instead of colors you can use different alpha values that lead to a different shade of gray (or blue if selected)

    Make the background of your icons transparent.

提交回复
热议问题