Dor Shpindler
Dor Shpindler

Reputation: 36

customize UIBarButtonItem to have no border?

I'm trying to create a UIBarButtonItem that looks like the "list" button on the iPod.app so I have 2 questions:

  1. How can I set the icon to look like the iPod's one? I saw it in other apps, but couldn't find it on xcode. (the icon that appears on the right side of the navigation bar on the "now playing" screen)

  2. how can I set the UIBarButtonItem's image to show without it's default border?

Upvotes: 0

Views: 1021

Answers (1)

Vitalii Boiarskyi
Vitalii Boiarskyi

Reputation: 1393

Try adding custom view with button you want as a subview to your bar;

UIView* myView = [[UIView alloc] initWithFrame:myBar.bounds];
UIbutton* myBtn = [[UIButton alloc] initWithFrame:CGRectMake(x,y,width,height)];
[myBtn setImage:myImage forState:UIControlStateNormal];

[myView addSubview:myBtn];
[myBar addSubview:myView];

Upvotes: 1

Related Questions