在tabbar 上添加图片、红点

来源:互联网 发布:梵高和提奥 知乎 编辑:程序博客网 时间:2024/04/29 02:25
在tabbar上添加图片代码
CGRect frame = CGRectMake(0, 0, 320, 49);    UIView *v = [[UIView alloc] initWithFrame:frame];    UIImage *img = [UIImage imageNamed:@"1.jpg"];    UIColor *color = [[UIColor alloc] initWithPatternImage:img];    v.backgroundColor = color;    [tab.tabBar insertSubview:v atIndex:0];    tab.tabBar.opaque = YES;

如果项目需求在tabbar上面加红点(也就是有信息提示红点)

 [self.tabBarController.tabBar addSubview:redpoint];//redpoint 可以是image 计算下坐标直接贴上去就ok了


0 0
原创粉丝点击