NavigationBar的title颜色改变代码:

//NavigationBar的title颜色改变代码:
[self.navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:19],NSForegroundColorAttributeName:[UIColor whiteColor]}];
//使navigationController的背景颜色为白色

  1. //放在最下面(放一个uiview在上面)
    UIView *navigView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kWidth, 64)];
    navigView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.3];
    [self.view addSubview:navigView];
  2. //隐藏半透明度
    self.navigationController.navigationBar.translucent = YES;
    self.navigationController.navigationBar.shadowImage = [[UIImage alloc]init];
    [self.navigationController.navigationBar setBackgroundImage:[[UIImage alloc]init] forBarMetrics:UIBarMetricsDefault];
  3. // fileDuration位置应该是一个为double类型的歌曲时长秒数
    //时间类型
    NSDate *date = [[NSDate alloc] initWithTimeIntervalSince1970:fileDuration];
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    if (fileDuration >= 3600) {
    [formatter setDateFormat:@"HH:mm:ss"];
    } else {
    [formatter setDateFormat:@"mm:ss"];
    }
    NSString *dateStr = [formatter stringFromDate:date];

你可能感兴趣的:(NavigationBar的title颜色改变代码:)