Ios 导航栏更改其上的导航栏';他自己的
我有一个包含UITAbleView的UIViewController 我使用块从视图控制器推送新视图:Ios 导航栏更改其上的导航栏';他自己的,ios,objective-c,uinavigationcontroller,uinavigationbar,Ios,Objective C,Uinavigationcontroller,Uinavigationbar,我有一个包含UITAbleView的UIViewController 我使用块从视图控制器推送新视图: _noviyVC.presentPlease = ^(UIViewController *controller) { [weakself.navigationController pushViewController:controller animated:YES]; }; - (void)tableView:(UITableView *)tableView didSelectRo
_noviyVC.presentPlease = ^(UIViewController *controller)
{
[weakself.navigationController pushViewController:controller animated:YES];
};
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
ProfileVCC *profile = [[ProfileVCC alloc] init];
profile.userId = _users[indexPath.row][@"id"];
if (self.presentPlease)
{
self.presentPlease(profile);
}
}
但最后我得到了这个:
导航栏将颜色更改为黑色。我做错了什么?我不知道为什么颜色会自动更改,但您可以使用下面的代码设置颜色,还可以检查您是否没有为UITableView的背景设置任何颜色
if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) {
// iOS 6.1 or earlier
[self.navigationController.navigationBar setTintColor:[UIColor yellowColor]];
} else {
// iOS 7.0 or later
[self.navigationController.navigationBar setBarTintColor:[UIColor yellowColor]];
self.navigationController.navigationBar.translucent = NO;
};
if(floor(NSFoundationVersionNumber)我无法了解颜色自动更改的原因,但您可以使用下面的代码设置颜色,还可以检查您是否未设置UITableView背景的任何颜色
if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) {
// iOS 6.1 or earlier
[self.navigationController.navigationBar setTintColor:[UIColor yellowColor]];
} else {
// iOS 7.0 or later
[self.navigationController.navigationBar setBarTintColor:[UIColor yellowColor]];
self.navigationController.navigationBar.translucent = NO;
};
if(floor(NSFoundationVersionNumber)试试这个
_noviyVC.presentPlease = ^(UIViewController *controller)
{
[self.navigationController pushViewController:controller animated:YES];
};
试试这个
_noviyVC.presentPlease = ^(UIViewController *controller)
{
[self.navigationController pushViewController:controller animated:YES];
};
谢谢,我忘了半透明:D谢谢,我忘了半透明:D