我知道通过以下方式将边框设置为按钮,
button.layer.cornerRadius = 0.0;
button.layer.borderWidth = 2.5;
button.layer.borderColor = [[UIColor darkGrayColor] CGColor];
但我需要知道如何删除或删除按钮的边框?
button.layer.borderWidth = 0.0;
会使边界看不见。
button.layer.borderColor = [UIColor colorWithRed:0.3 green:0.6 blue:0.9 alpha:0.1];
// set 'alpha' to something less than 1. -----^^^
试试这个 !
在UILabel上这不起作用,我使用了以下(考虑到你只添加了1个Sublayer)(这是Mono C#,但你可以很容易地翻译它)
label.Layer.Sublayers[0].RemoveFromSuperLayer();