版权声明:本文为博主原创文章,未经博主允许不得转载。 https://cloud.tencent.com/developer/article/1338021
UITextView *textView = [UITextView allocinitWithFrame:CGRectMake(10, 100, 200, 40)];
// 重点是改变textView的边框颜色,切记后边的CGColor
textView.layer.borderColor = [UIColor colorWithRed:215.0 / 255.0 green:215.0 / 255.0 blue:215.0 / 255.0 alpha:1 CGColor];
textView.font = UIFont systemFontOfSize:18;
textView.layer.borderWidth = 0.6f;
textView.layer.cornerRadius = 6.0f;
self.view addSubview:textView;