-
(void)createTitleMenuView
{
_titleMenuView = [[UIView alloc] initWithFrame:CGRectMake(YGScreenWidth/2-60, -80, 120, 80)];
//阴影
UIBezierPath *shadowPath = [UIBezierPath bezierPathWithRect:_titleMenuView.bounds];
_titleMenuView.layer.masksToBounds = NO;
_titleMenuView.layer.shadowColor = [UIColor blackColor].CGColor;
_titleMenuView.layer.shadowOffset = CGSizeMake(3.0f, 3.0f);
_titleMenuView.layer.shadowOpacity = 0.4f;
_titleMenuView.layer.shadowRadius = 8;
_titleMenuView.layer.shadowPath = shadowPath.CGPath;NSArray *array = @[@"筹集中",@"已完成"];
for (int i = 0; i<2; i++) {
UIButton coverButton = [[UIButton alloc]initWithFrame:CGRectMake(0,40i,120,40)];
coverButton.tag = 1000+i;
[coverButton addTarget:self action:@selector(changeStatesBtnAction:) forControlEvents:UIControlEventTouchUpInside];
coverButton.titleLabel.font = [UIFont systemFontOfSize:YGFontSizeBigOne];
[coverButton setTitleColor:colorWithBlack forState:UIControlStateNormal];
[coverButton setTitleColor:colorWithMainColor forState:UIControlStateSelected];
[coverButton setTitle:array[i] forState:UIControlStateNormal];
[_titleMenuView addSubview:coverButton];
}
_titleMenuView.backgroundColor = colorWithYGWhite;
self.titleMenuView.alpha = _titleButton.isSelected;
[self.view addSubview:_titleMenuView];
UIButton *coverButton = [_titleMenuView viewWithTag:1000];
coverButton.selected = YES;
}
网友评论