1
我有我想创建一个自定义uinavigationn吧我想这码iphone:在导航栏设置背景图片是不恰当
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 ...有没有办法让它合适?
作为一种替代方案,您可能可以在代码中缩放图像,但这并不是一件有趣的事情,可能比仅仅将图像设置为正确的尺寸更麻烦。 – bgoers 2012-07-09 20:07:08
当您向导航项添加提示时,图像会重复出现,并且我们无法将图像拉伸至导航栏,因此存在问题。 – djleop 2012-12-05 13:51:19