2012-01-10 59 views

回答

10

這很容易。你必須添加石英核心框架

和寫入以下行

CALayer *imageLayer = textView.layer; 
[imageLayer setCornerRadius:10]; 
[imageLayer setBorderWidth:1]; 
imageLayer.borderColor=[[UIColor lightGrayColor] CGColor]; 
+0

我知道,但我想給框架的TextView的邊框。 – 2012-01-10 09:40:11

+0

是否意味着你必須顯示textView的邊框? – Hiren 2012-01-10 10:11:38

5

添加 「QuartzCore」 框架和.h文件中導入它在你的HeaderFile

#import <QuartzCore/QuartzCore.h> 

UITextView *TextView; 

用於在TextView中設置邊框

TextView.layer.borderWidth = 1.0f; 

    TextView.layer.borderColor = [[UIColor grayColor] CGColor]; //[YounCan Use any Color For Border] 
0

這有非常簡單的集成和輝煌的文本視圖定製:https://github.com/99centsappdevelopment/JSTextView

+0

嘗試發佈多個鏈接到您的項目:例如一些相關的行。如果你想保持它的促銷(和*輝煌*),張貼它作爲評論。 – Bigood 2015-02-09 18:41:57