0

I have added a bar button item to my UIToolBar in Interface Builder (Style: Plain, Identifier: Custom, Image: FaceBook_Icon.png). I desire to set the button size to the size of my custom image (40x40), however, adjusting the bar item size in the IB attributes does not affect the button's size (i.e. the bar button is still larger than the image). How may I adjust the size, so that can only see my custom image?

Thanks in advance! Jeremy

LuckyLuke
  • 47,771
  • 85
  • 270
  • 434
JRoss
  • 177
  • 10
  • 23

2 Answers2

0

Do you have to do it in IB? if not simply create a 40*40 UIButton in your viewcontroller and set it the customized view of the tabbar button.

boreas
  • 1,041
  • 1
  • 15
  • 30
  • 1
    Setting the width of my UIBarButton Item to the width of my UIImage in the viewDidLoad Method does not change the button's width either (i.e. button is still larger than the image that has been placed inside it): fbButton.width = fbImage.size.width; – JRoss May 29 '11 at 05:28
0

In IB You can adjust the size of any view.Select your button. Set it as customtype. Then set your image. Now don't grag and scale the button. Just select it and set its width and height values in IB. For setting width and height select the scale imaged button of IB(refer image. You can see a button in red color)

Adarsh V C
  • 2,314
  • 1
  • 20
  • 37