您的位置:首页 > 其它

设置tabbar标签栏的背景图片 insertSubview: atIndex:

2012-07-01 16:34 239 查看
//设置tabbarcontroller的tabbaritem图片的大小

UIImage *tabbarimage=[UIImage
imageNamed:@"first.png"];

UIImageView *tabBarBackgroundImageView = [[UIImageView
alloc] initWithFrame:CGRectMake(0, 0,
self.tabBar.frame.size.width,
self.tabBar.frame.size.height)];

//tabBarBackgroundImageView.contentMode = UIViewContentModeScaleAspectFit;//效果将按原图原来的比例缩放
tabBarBackgroundImageView.image =tabbarimage;
[self.tabBar
insertSubview:tabBarBackgroundImageView
atIndex:1]; //atIndex决定你的图片显示在标签栏的哪一层
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: