开发者

add images to toolbar

i have 5 UIbarButton items in a toolbar, how can i set images on each barbutton, i tried through IB, but it not coming up, how can i do it ptogrammatically? one of bar button looks like this

aBar = [[UIBarButtonItem alloc] initWithI开发者_开发百科mage:[UIImage imageNamed:@"a.png"]style:UIBarButtonItemStylePlain target:self action:@selector(aMethod)];

i already conencted all barbuttons ion IB.

regards


Should work with IB. Be sure that your button type is set to Custom maybe?


jus check if the a.png is added to your project.

Or first take create a UIImage *img = [UIImage imageNamed:@"a.png"];

also check if IBoutlets are correctly connected.

But mostly the problem is because the image returned is nil.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜