开发者

UITextView - Setting Border Color

开发者 https://www.devze.com 2023-04-12 20:16 出处:网络
In MonoTouch I am trying to set the border color, but the BorderColor is inaccessible due to its protection level and can\'t be changed.

In MonoTouch I am trying to set the border color, but the BorderColor is inaccessible due to its protection level and can't be changed.

public class BorderedUITextView:UITextView
{
    public BorderedUITextView (Rec开发者_开发百科tangleF Frame):base(Frame)
    {
        this.Layer.BorderColor (UIColor.Black);  ????????????
        this.Layer.BorderWidth = 1.3f;
        this.Layer.CornerRadius = 15f;
        this.ClipsToBounds = true;
    }
}


you can also get the CGColor from the UiColor

this.Layer.BorderColor  = UIColor.Black.CGColor;


Layer(if a CoreAnimation.CALayer) BorderColor is a property (not a method) as such it should be assigned like:

this.Layer.BorderColor = x;

Also it is a CGColor not an UIColor

this.Layer.BorderColor = new MonoTouch.CoreGraphics.CGColor (0.5f, 0.5f);
0

精彩评论

暂无评论...
验证码 换一张
取 消