views:

12

answers:

1

Hi,

I have created a custom bar button item in code.

UIButton* backButton = [UIButton buttonWithType:102]; // left-pointing shape! [backButton addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside]; [backButton setTitle:@"Custom Item" forState:UIControlStateNormal];

// create button item -- possible because UIButton subclasses UIView! UIBarButtonItem* backItem = [[UIBarButtonItem alloc] initWithCustomView:backButton]; self.navigationItem.leftBarButtonItem = backItem;

But it displays as dark blue. I need to get the default look and feel for this. How to set the default look and feel?

Regards,

Dilshan

A: 

Probably the wrong question, but if you are concerned about look and feel why are you using undefined UIButtonType to finesse 'left-pointing' button? The left-pointing button is intended for popping back up navigation stack, and I think that it pretty much comes for free if you use UINavigationController.

westsider
May be I have used a confusing variable name. Actually I need to customize this button. The intended functionality is not back function.
Dilshan
So, you aren't looking to get a left-pointing button? Just want to be clear on what the constraints are.
westsider
yes customized left button
Dilshan
I know it's off topic, somewhat, but does '102' actually yield a left-pointing button for you? It doesn't for me - I just get a rounded rectangle button with, as you know, a blue background color. Thanks.
westsider