美文网首页
iOS 给Button加边框、切圆角、

iOS 给Button加边框、切圆角、

作者: 隔墙送来秋千影 | 来源:发表于2018-05-29 17:08 被阅读11次
    UIButton *skipButton = [[UIButton alloc]initWithFrame:CGRectMake(DDScreenW*0.8, DDScreenW*0.1, 60, 25)];
    [skipButton setTitle:@"跳过" forState:UIControlStateNormal];
    [skipButton.titleLabel setFont:[UIFont systemFontOfSize:14.0]];
    [skipButton setBackgroundColor:[UIColor whiteColor]];
    [skipButton setTitleColor:BLUE_COLOR forState:UIControlStateNormal];
    [skipButton.layer setCornerRadius:(skipButton.frame.size.height * 0.5)];
    skipButton.layer.borderColor = [BLUE_COLOR CGColor];
    skipButton.layer.borderWidth = 1.5f;
    [skipButton addTarget:self action:@selector(buttonClick:) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:skipButton];
    
    1212

    相关文章

      网友评论

          本文标题:iOS 给Button加边框、切圆角、

          本文链接:https://www.haomeiwen.com/subject/kouajftx.html