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

//设置tabbarcontrollertabbaritem图片的大小

    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决定你的图片显示在标签栏的哪一层

你可能感兴趣的:(设置tabbar标签栏的背景图片 insertSubview: atIndex:)