1.在创建textView的时候,赋值其文本属性

        即

textView.text = @"内容"

 

 

 

        2.在开始编辑的代理方法中进行如下操作

 

- (void)textViewDidBeginEditing:(UITextView *)textView {

    if ([textView.text isEqualToString:@"内容"]) {

        textView.text = @"";

    }

}

 

        3.在结束编辑的代理方法中进行如下操作

- (void)textViewDidEndEditing:(UITextView *)textView {

    if (textView.text.length<1) {

        textView.text = @"内容";

    }

}

 

相关文章:

  • 2021-07-07
  • 2022-12-23
  • 2022-12-23
  • 2021-05-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-03
  • 2022-12-23
  • 2021-11-21
  • 2021-11-06
  • 2022-01-22
相关资源
相似解决方案