首页 > 代码库 > textView 圆角
textView 圆角
#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; // 商品标题 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; // 添加商品标题placeholder labelplaceHorder=[[UILabel alloc]initWithFrame:CGRectMake(25, 105,200,20)]; labelplaceHorder.text = @"请添加商品描述"; 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; // 设置为不可用 [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]; //实现UITextView的代理 -(void)textViewDidChange:(UITextView *)textView{ if (imputFeedBackTextView.text.length == 0) { labelplaceHorder.text = @"请添加商品描述"; }else{ labelplaceHorder.text = @""; }}
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。