我想在我的 TextView 周围有边框;为此,我做了以下工作:
textView.layer.borderWidth = 5.0f;
textView.layer.borderColor = [UIColor grayColor];
我收到以下警告:
warning: passing argument 1 of 'setBorderColor:' from incompatible pointer type
更新1:我的边框不可见
最佳答案
您的问题是 -[CALayer setBorderColor:]
采用 CGColorRef
类型的对象。您需要做的是将颜色对象转换为符合:
textView.layer.borderColor = [UIColor grayColor].CGColor;
希望对您有所帮助!
关于iphone - 问题在 -[CALayer setBorderColor :],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4373925/