Textview rounded corner

Source: Internet
Author: User

# Import <quartzcore/quartzcore. h>

[Self. content. layer setbackgroundcolor: [[uicolor whitecolor] cgcolor];
[Self. content. layer setbordercolor: [[uicolor graycolor] cgcolor];
[Self. content. layer setborderwidth: 1.0];
[Self. content. layer setcornerradius: 8.0];
[Self. content. layer setmaskstobounds: Yes];
Self. content. clipstobounds = yes;

 

 

 

 

// Product title

Imputfeedbacktextview = [[uitextview alloc] initwithframe: cgrectmake (20,100,280,130)];

Imputfeedbacktextview. font = [uifont systemfontofsize: 15];

Imputfeedbacktextview. backgroundcolor = [uicolor whitecolor];

[Self. View addsubview: imputfeedbacktextview];

Imputfeedbacktextview. Hidden = no;

Imputfeedbacktextview. Delegate = self;

// Add the product title placeholder

Labelplacehorder = [[uilabel alloc] initwithframe: cgrectmake (25,105,200, 20)];

Labelplacehorder. Text = @ "add product description ";

Labelplacehorder. font = [uifont systemfontofsize: 15];

Labelplacehorder. textcolor = [uicolor colorwithred: 200/256. 0 Green: 200/256. 0 Blue: 200/256. 0 ALPHA: 1];

// Labelgoodsdescription. Enabled = no; // set to unavailable

[Imputfeedbacktextview. layer setbackgroundcolor: [[uicolor whitecolor] cgcolor];

[Imputfeedbacktextview. layer setbordercolor: [[uicolor colorwithred: 0.85 Green: 0.85 Blue: 0.85 ALPHA: 1] cgcolor];

[Imputfeedbacktextview. layer setborderwidth: 1.0];

[Imputfeedbacktextview. layer setcornerradius: 6.0];

[Imputfeedbacktextview. layer setmaskstobounds: Yes];

Imputfeedbacktextview. clipstobounds = yes;

[Self. View addsubview: labelplacehorder];

// Implement uitextview proxy

 

-(Void) textviewdidchange :( uitextview *) textview

{

 

If (imputfeedbacktextview. Text. Length = 0 ){

Labelplacehorder. Text = @ "add product description ";

} Else {

Labelplacehorder. Text = @"";

}

}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.