我无法更改导航栏后退按钮的颜色.有帮助吗?我自定义了UINavigationBar类,但我无法更改后退按钮的颜色.
UINavigationBar class code
#import
#import "UINavigationBar.h"
@interface UINavigationBar ( Category )
{
}
.m file code
- (void) drawRect:(CGRect)rect
{
[[UIImage imageNamed:@"top.png"] drawInRect:rect];
self.tintColor = [UIColor colorWithRed:38 green:65 blue:82 alpha:1];
}
我无法改变后退按钮的颜色.
使用此功能,您可以更改所有导航按钮的颜色:
[[UIBarButtonItem appearance] setTintColor:[UIColor redColor]];
Run Code Online (Sandbox Code Playgroud)
用以下内容替换redColor以调整按钮的颜色:
colorWithRed:0/255.0 green:144/255.0 blue:200/255.0 alpha:1.0// pick your color using this.
Run Code Online (Sandbox Code Playgroud)
注意:适用于iOS 5和>
| 归档时间: |
|
| 查看次数: |
5985 次 |
| 最近记录: |