我有一个表格视图,我想制作一个自定义的 uinavigationn 栏我试过这段代码
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, self.view.bounds.size.width, self.view.bounds.size.height)];
//here for v, width= navBar width and height=navBar height
//
[view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"newsBanner.png"]]];
[self.navigationController.navigationBar addSubview:view];
问题是图像没有居中,因为它的尺寸是 640 x 72 ......有没有办法让它适合?