开发者

Adjusting the Size of a UIToolBar Button to the Size of a Custom Image with Interface Builder

开发者 https://www.devze.com 2023-03-08 19:17 出处:网络
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),

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(

Adjusting the Size of a UIToolBar Button to the Size of a Custom Image with Interface Builder

)


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消