Tuesday 15 February 2011

ios - How to style UITextview to like Rounded Rect text field? -


I am using a text visual as a comment composer.

In the property inspector I can not find anything like a border style property so that I can use a round rack, like UITextField .

So, the question is: How do I like a UITextView like a UITextField with a rounded rectangle?

No built-in style that you do not have to choose, in this quartzakor structure It involves writing some code using:

  // First, you #import & lt; Quartzcore / Quartzcor j & gt; // // // I add the UITXView to the code here, if it is also added to the IB, then it will work if IITextView * textView = [[UITXXL ALL] InitVithframe: CGRactMake (50, 220, 200, 100)]; // UITEFFESTFIELD to see the boundary [textview. Players SetborderRall: [[[UIColor Gray Color] Colophon with Colophon: 0.5] CGColor]]; [TextView.layer setBorderWidth: 2.0]; // The circular corner part, where you specify the corner radius of your view: textView.layer.cornerRadius = 5; TextView.clipsToBounds = Yes;  

It only works on OS 3.0 and above, but I think this is actually the real platform.


No comments:

Post a Comment