UITextView边框没有出现

时间:2014-08-04 23:24:22

标签: objective-c ios7

- (void)setupTextviewBorder {
self.descTextView.layer.borderWidth = 50.0;
float f = 197.0/255.0;
self.descTextView.layer.borderColor = (__bridge CGColorRef)([UIColor colorWithRed:f green:f blue:f alpha:1]);
self.descTextView.layer.cornerRadius = 20.0;
self.descTextView.layer.masksToBounds = true;
self.descTextView.autoresizingMask = UIViewAutoresizingFlexibleWidth;

是的我正在调用此方法,我可以记录该层。当我查看它时,我看不到边框。

enter image description here

1 个答案:

答案 0 :(得分:3)

改变这个:

self.descTextView.layer.borderColor = (__bridge CGColorRef)([UIColor colorWithRed:f green:f blue:f alpha:1]);

对此:

self.descTextView.layer.borderColor = [UIColor colorWithRed:f green:f blue:f alpha:1].CGColor;