开发者

UINavigationBar back button skinning

开发者 https://www.devze.com 2022-12-16 18:26 出处:网络
how can I skin the look of the button in UINavigationBar? Tried this UIBarButtonItem *myToolbarItem = [[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@\"myImage.png\"] style:UIBarButtonIt

how can I skin the look of the button in UINavigationBar?

Tried this UIBarButtonItem *myToolbarItem = [[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"myImage.png"] style:UIBarButtonItemStyleBordered target:self action:nil] autorele开发者_运维问答ase];

Doesn't quite do it.

Thanks, Tee


try to do this:

UIBarButtonItem *customItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"imageName.png"] style:UIBarButtonItemStyleBordered target:self action:@selector(nameOfSomeMethod:)];
    self.navigationItem.leftBarButtonItem = customItem;
    [customItem release];

This will place your custom button on the left side of your navigation bar.

Cheers,
VFN

0

精彩评论

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

关注公众号