gpt4 book ai didi

ios - UINavigationBar 变黑

转载 作者:可可西里 更新时间:2023-11-01 05:41:16 26 4
gpt4 key购买 nike

首先,当我调用 presentViewController:navigationController 时,它会显示正常的绿色导航栏。但是在动画完成后导航栏变得有点暗。

if(!userPageViewController)
userPageViewController = [[UserPageViewController alloc]initWithUser:tempUser];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:userPageViewController];
[self presentViewController:navigationController animated:YES completion:nil];

当我按下主页按钮时,导航栏像这张图片一样变成黑色。 https://dl.dropboxusercontent.com/u/14066789/2013-12-04%2012.27.45.png

xib 文件中的顶部栏设置为半透明导航栏为什么会变黑?

- (void)viewDidLoad
{
[super viewDidLoad];
self.title = @"Личный кабинет";
[myTableView setBackgroundColor:[UIColor clearColor]];

UIBarButtonItem *btn = [[UIBarButtonItem alloc] initWithTitle:@"Закрыть" style:UIBarButtonItemStyleBordered target:self action:@selector(backPressed:)];
self.navigationItem.leftBarButtonItem = btn;
self.navigationItem.backBarButtonItem = nil;

UIBarButtonItem *exitBtn = [[UIBarButtonItem alloc] initWithTitle:@"Выход" style:UIBarButtonItemStyleBordered target:self action:@selector(logOut:)];
self.navigationItem.rightBarButtonItem = exitBtn;
scroll.contentSize = CGSizeMake(320.0f, 400.0f);

if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
self.edgesForExtendedLayout = UIRectEdgeNone;

}

-(void)viewWillAppear:(BOOL)animated
{
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7)
{
UIColor * barColor = [UIColor
colorWithRed:222.0/255.0
green:255.0/255.0
blue:229.0/255.0
alpha:1.0];
[self.navigationController.navigationBar setBarTintColor:barColor];
UIColor * barTintColor = [UIColor
colorWithRed:48.0/255.0
green:140.0/255.0
blue:76.0/255.0
alpha:1.0];
[self.navigationController.navigationBar setTintColor:barTintColor];

NSDictionary *navbarTitleTextAttributes = [NSDictionary dictionaryWithObjectsAndKeys:
barTintColor,UITextAttributeTextColor,
[UIColor clearColor], UITextAttributeTextShadowColor,
[NSValue valueWithUIOffset:UIOffsetMake(0, 0)], UITextAttributeTextShadowOffset, nil];

[[UINavigationBar appearance] setTitleTextAttributes:navbarTitleTextAttributes];


}
else
{
UIColor * barColor = [UIColor
colorWithRed:73.0/255.0
green:208.0/255.0
blue:114.0/255.0
alpha:1.0];
[self.navigationController.navigationBar setTintColor:barColor];

}

}

最佳答案

我遇到了同样的问题。通过关闭 Storyboard 中根导航 Controller 的导航栏属性中的“Transcluent”复选框进行修复。您需要打开名为“Document Outline”的左 Pane ,左下角有小按钮以找到导航栏。

关于ios - UINavigationBar 变黑,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20372860/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com