自定义UINavigationBar上面的按钮

定制回退按钮

1  UIImage *buttonBack30 = [[UIImage imageNamed:@"button_back_textured_30"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 13, 0, 5)];
2  UIImage *buttonBack24 = [[UIImage imageNamed:@"button_back_textured_24"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 12, 0, 5)];
3  [[UIBarButtonItem appearance] setBackButtonBackgroundImage:buttonBack30
                                                  forState:UIControlStateNormal
                                                barMetrics:UIBarMetricsDefault];
4  [[UIBarButtonItem appearance] setBackButtonBackgroundImage:buttonBack24
                                                  forState:UIControlStateNormal
                                                barMetrics:UIBarMetricsLandscapePhone];

 

设置右侧按钮

1 UIImage *button30 = [[UIImage imageNamed:@"button_textured_30"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 5, 0, 5)];
2 UIImage *button24 = [[UIImage imageNamed:@"button_textured_24"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 5, 0, 5)];
3 [[UIBarButtonItem appearance] setBackgroundImage:button30
4                                             forState:UIControlStateNormal
5                                           barMetrics:UIBarMetricsDefault];
6 [[UIBarButtonItem appearance] setBackgroundImage:button24
7                                             forState:UIControlStateNormal
8                                           barMetrics:UIBarMetricsLandscapePhone];

 

posted @ 2013-02-18 13:49  diablo大王  阅读(784)  评论(0编辑  收藏  举报