开发者

UITextView - Setting Border Color

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜