UITextView - 设置边框颜色
在 MonoTouch 中,我尝试设置边框颜色,但由于其保护级别,BorderColor 无法访问且无法更改。
public class BorderedUITextView:UITextView
{
public BorderedUITextView (RectangleF Frame):base(Frame)
{
this.Layer.BorderColor (UIColor.Black); ????????????
this.Layer.BorderWidth = 1.3f;
this.Layer.CornerRadius = 15f;
this.ClipsToBounds = true;
}
}
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 (RectangleF Frame):base(Frame)
{
this.Layer.BorderColor (UIColor.Black); ????????????
this.Layer.BorderWidth = 1.3f;
this.Layer.CornerRadius = 15f;
this.ClipsToBounds = true;
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您还可以从 UiColor 获取 CGColor
you can also get the CGColor from the UiColor
Layer
(如果是CoreAnimation.CALayer
)BorderColor
是一个属性(而不是方法),因此它应该这样分配:它也是一个
CGColor
不是UIColor
Layer
(if aCoreAnimation.CALayer
)BorderColor
is a property (not a method) as such it should be assigned like:Also it is a
CGColor
not anUIColor