iOS--圆角按钮

Posted 其意亦凡

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了iOS--圆角按钮相关的知识,希望对你有一定的参考价值。

//进入按钮
    UIButton *enterMainButton = [[UIButton alloc] initWithFrame:CGRectMake(65, self.PageHeight-120,250 , 45)];
    enterMainButton.layer.borderWidth = 1;
    enterMainButton.layer.cornerRadius = 24;
    enterMainButton.layer.borderColor = [UIColor colorWithRed:108/255.0 green:122/255.0 blue:149/255.0 alpha:1].CGColor;
    [enterMainButton setTitle:@"进入应用" forState:UIControlStateNormal];
    enterMainButton.titleLabel.font = [UIFont systemFontOfSize: 14.0];
    [enterMainButton setTitleColor:[UIColor colorWithRed:108/255.0 green:122/255.0 blue:149/255.0 alpha:1]forState:UIControlStateNormal];
    
    enterMainButton.showsTouchWhenHighlighted = YES;
    enterMainButton.alpha = 0;
    
    [enterMainButton addTarget:self action:@selector(intoButtonClick:) forControlEvents:UIControlEventTouchUpInside];
    
    
    [UIView animateWithDuration:3.0 animations:^{
        enterMainButton.alpha = 1.0;
    }];

 

以上是关于iOS--圆角按钮的主要内容,如果未能解决你的问题,请参考以下文章

iOS绘制物理按钮 - 透明圆角渐变边框

带有圆角和背景错误的 iOS UIButton

如何在 iOS 中检测屏幕圆角

UIButton 在 IOS 6 中显示带有圆角的默认白色背景,但在 IOS 7 中没有

圆角渐变 UIButton iOS

iOS中设置圆角的方式