0

I have 4 buttons on uitoolbar and I have images for all four button for default state only. On selection, I need to show it as selected. Now my question is that how to show button as selected when there is no image for selected state. I want to show the button as mentioned in following image. How to do it.enter image description here

Rahul Gupta
  • 808
  • 11
  • 15
  • 6
    Use a tab bar. What you have shown is an image of [UITabBarController](http://developer.apple.com/library/ios/#documentation/uikit/reference/UITabBarController_Class/Reference/Reference.html) and not a [UIToolbar](http://developer.apple.com/library/ios/#documentation/uikit/reference/UIToolbar_Class/Reference/Reference.html). – iDev Dec 21 '12 at 19:51
  • @ACB: Thanks, but I cannot use UITabBarController for some reason. – Rahul Gupta Dec 21 '12 at 19:55
  • @ACB: Is there any other way to do this? – Rahul Gupta Dec 21 '12 at 19:56
  • 1
    @RahulGupta for what reason? If there really is a reason, then why don't you use a simple `UITabBar` instead of the whole `UITabBarController`? –  Dec 21 '12 at 19:59
  • @H2CO3: Actually I have 10 to 12 buttons at bottom, so I have added all buttons in scrollbar. – Rahul Gupta Dec 21 '12 at 20:04

1 Answers1

0

You should look for the flag: "forState". I would appear like this:

forState:UIControlStateNormal

when your tab is being selected, you should change the state to "UIControlStateSelected".

user1922878
  • 2,833
  • 3
  • 13
  • 7