先看效果图
第一步 创建tabbarView 继承自 UIView
tabbarview上边需要添加的控件
@property (nonatomic, strong) UIButton *findButton;// 首页按钮
@property (nonatomic, strong) UIButton *lanMuButton;// 栏目按钮
@property (nonatomic, strong) UIButton *huodongButton; 发现按钮
@property (nonatomic, strong) UIButton *wodeButton; 我的按钮
@property (nonatomic, strong) UILabel *findLabel; 首页label
@property (nonatomic, strong) UILabel *lanmuLabel; 栏目label
@property (nonatomic, strong) UILabel *huodonglabel; 活动label
@property (nonatomic, strong) UILabel *wodeLabel; 我的label
@property (nonatomic, strong)UIImageView *centerButton; 中间拍摄按钮
控件的创建和添加代码此处就省略 着重说一下中间大圈是怎么搞得
中间圆形View添加点击手势 在tabbarcontroller中实现
- (void)centerBtnClicked{
拍照点击的协议方法
[self.mytabbardelegate centerButtonSelect];
}
四个button的点击方法 每个button通过设置tag值来区分
- (void)buttonAction:(UIButton *)button{
if (button.tag == 0) {
四个button的点击协议方法 在tabbarcontroller中实现
[self.mytabbardelegate tabbarButtonSelect:0];
/// 同时变换四个button的图片和label文字的颜色
[self.findButton setImage:[UIImage imageNamed: