- (void)viewDidLoad {
suggesView = [[UITextView alloc]initWithFrame:CGRectMake(5, 75, 310, 200)];
suggesView.delegate = self;
suggesView.scrollEnabled = NO;
suggesView.tag = 125;
[self.view addSubview:suggesView];
[self createfabuButton];
placehodel = [UILabel genLabelWithFrame:CGRectMake(10, 10, 200, 20) andText:@"请在反馈中留下您的联系方式"];
placehodel.font = [UIFont systemFontOfSize:14];
placehodel.enabled = NO;
placehodel.backgroundColor = [UIColor clearColor];
[suggesView addSubview:placehodel];
//让textView内容从上边开始编辑
if([self respondsToSelector:@selector(setAutomaticallyAdjustsScrollViewInsets:)]){
self.automaticallyAdjustsScrollViewInsets = NO;
}
}
- (void)textViewDidChange:(UITextView *)textView
{
if (textView.text.length == 0) {
placehodel.text = @"请在反馈中留下您的联系方式";
}
else
{
placehodel.text = @"";
}
}
TextFieldView设置背景提示placehodel,让textFiledView输入从最上面输入
最新推荐文章于 2020-12-05 06:33:41 发布