我正在尝试制作一个带有背景渐变、导航栏和徽标的基本应用程序。在模拟器中启动时会弹出一个错误,说Springboard 启动失败错误:-3
我在 ViewController 的代码中使用以下两个:-
- (void)viewDidLoad
{
[super viewDidLoad];
self.navigationItem.title = @"Menu";
UIView *view = [[UIView alloc]initWithFrame:CGRectMake(257, 3, 320, 44)];
UIImageView *image = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"ic_home.png"]];
[image setFrame:CGRectMake(0, 0, 59, 36)];
[view addSubview:image];
[self.navigationController.navigationBar addSubview:view];
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
//Add gradient background
CAGradientLayer *bgLayer = [BackgroundLayer yellowGradient];
bgLayer.frame = self.view.bounds;
[self.view.layer insertSublayer:bgLayer atIndex:0];
}