button設定邊寬和圓角

weixin_34104341發表於2020-04-07
   UIButton *meifuButton = [UIButton buttonWithType:UIButtonTypeSystem];
        [meifuButton setTitle:@"分享到美膚" forState:UIControlStateNormal];
        [meifuButton setTitleColor:REDSELECTCOLORE forState:UIControlStateNormal];
        meifuButton.frame = CGRectMake(SCREEN_WIDTH - 100, 20, 90, 25);
        meifuButton.layer.cornerRadius = 8; //設定半徑
        meifuButton.layer.borderWidth = 1//設定邊寬
        meifuButton.layer.borderColor = REDSELECTCOLORE.CGColor; //設定邊部的顏色
        [_shareContent addSubview:meifuButton];

轉載於:https://www.cnblogs.com/tian-sun/p/4849790.html

相關文章