2024年2月21日发(作者:)
//两个按钮 if (cancleTitle && sureTitle) {
Btn = [UIButton buttonWithType:UIButtonTypeSystem]; = CGRectMake(0, CGRectGetMaxY(), (AlertW-1)/2, 40); [Btn setBackgroundImage:[self imageWithColor:[UIColor colorWithRed:255/255.0 green:255/255.0 blue:255/255.0 alpha:0.2]] forState:UIControlStateNorma [Btn setTitle:cancleTitle forState:UIControlStateNormal]; //[Btn setTitleColor:[UIColor grayColor] forState:UIControlStateNormal]; = 1; [Btn addTarget:self action:@selector(buttonEvent:) forControlEvents:UIControlEventTouchUpInside]; [Btn setBackgroundImage:[self imageWithColor:[UIColor colorWithRed:255/255.0 green:255/255.0 blue:255/255.0 alpha:0.2]] forState:UIControlStateSelect
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect: byRoundingCorners:UIRectCornerBottomLeft cornerRadii:CGSizeMake CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; = ; = ; = maskLayer;
[iew addSubview:Btn]; }
if (cancleTitle && sureTitle) { eView = [[UIView alloc] init]; = CGRectMake(CGRectGetMaxX(), CGRectGetMaxY(), 1, 40); oundColor = [UIColor colorWithWhite:0.8 alpha:0.6]; [iew addSubview:eView]; }
if(sureTitle && cancleTitle){
n = [UIButton buttonWithType:UIButtonTypeSystem]; = CGRectMake(CGRectGetMaxX(), CGRectGetMaxY(), (AlertW-1)/2+1, 40); [n setBackgroundImage:[self imageWithColor:[UIColor colorWithRed:255/255.0 green:255/255.0 blue:255/255.0 alpha:0.2]] forState:UIControlStateNormal]; [n setTitle:sureTitle forState:UIControlStateNormal]; //[n setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; = 2; [n addTarget:self action:@selector(buttonEvent:) forControlEvents:UIControlEventTouchUpInside];
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect: byRoundingCorners:UIRectCornerBottomRight cornerRadii:CGSizeMake CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; = ; = ; = maskLayer;
[iew addSubview:n];
}
//只有取消按钮 if (cancleTitle && !sureTitle) {
Btn = [UIButton buttonWithType:UIButtonTypeSystem]; = CGRectMake(0, CGRectGetMaxY(), AlertW, 40); [n setBackgroundImage:[self imageWithColor:[UIColor colorWithRed:255/255.0 green:255/255.0 blue:255/255.0 alpha:0.2]] forState:UIControlStateSelected [Btn setBackgroundImage:[self imageWithColor:[UIColor colorWithRed:255/255.0 green:255/255.0 blue:255/255.0 alpha:0.2]] forState:UIControlStateNorma [Btn setBackgroundImage:[self imageWithColor:[UIColor colorWithRed:255/255.0 green:255/255.0 blue:255/255.0 alpha:0.2]] forState:UIControlStateSelect [Btn setTitle:cancleTitle forState:UIControlStateNormal]; //[Btn setTitleColor:[UIColor grayColor] forState:UIControlStateNormal]; = 1; [Btn addTarget:self action:@selector(buttonEvent:) forControlEvents:UIControlEventTouchUpInside];
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect: byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRig CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; = ; = ; = maskLayer;
[iew addSubview:Btn]; }
//只有确定按钮 if(sureTitle && !cancleTitle){


发布评论