导航面板iphone中的颜色按钮

如何制作这种黄色按钮灰色的阴影? 我试图添加图像,但不成功。

这是一个屏幕截图:


这是我当前的代码:


- /id/initWithStyle:/UITableViewStyle/style {
if /self = [super initWithStyle:style]/ {

UIBarButtonItem *addButton = [[UIBarButtonItem alloc]
initWithTitle:NSLocalizedString/@"Settings", @""/
style:UIBarButtonItemStyleDone
target:self
action:@selector/GoToSettings/];
[addButton setImage:[[UIImage imageNamed:@"bg_table.png"] retain]];

self.navigationItem.rightBarButtonItem = addButton;
self.navigationItem.hidesBackButton = TRUE;
self.view.backgroundColor = [UIColor blackColor];
}
return self;
}
已邀请:

快网

赞同来自:

self.navigationItem.rightBarButtonItem.tintColor = [UIColor colorWithRed:0.1f green:0.66f blue:0.26f alpha:0.7];

郭文康

赞同来自:

以。。。开始 iOS 5.0 然后你可以用:


[[UINavigationBar appearance] setTintColor:[UIColor yellowColor]];

知食

赞同来自:

UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
[button setBackgroundImage:[UIImage imageNamed:@"button_main.png"]
forState:UIControlStateNormal];
[button addTarget:self action:@selector/GotoSettings/
forControlEvents:UIControlEventTouchUpInside];
button.frame = CGRectMake/x, y, x1, x2/;

UIBarButtonItem *menuButton = [[UIBarButtonItem alloc] initWithCustomView:menu];
self.navigationItem.rightBarButtonItem = menuButton;

[button release];
[menuButton release];

喜特乐

赞同来自:

没有你自己的形象,这是不可能的。

裸奔

赞同来自:

实际上,有可能且不使用按钮的按钮。


viewController.navigationController.navigationBar.tintColor = 
[UIColor colorWithRed:0.16f green:0.36f blue:0.46 alpha:0.8];

帅驴

赞同来自:

在导航窗格上安装按钮的图像时,可以设置

为了她 UIImageRenderingModeAlwaysOriginal:


[addButton setImage:[[[UIImage imageNamed:@"bg_table.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] retain]];


这里
https://coderoad.ru/21252194/
.

要回复问题请先登录注册