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 doe开发者_Python百科s 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
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(
)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.
精彩评论