Placeholder in UITextView

前端 未结 30 2857
野趣味
野趣味 2020-11-22 16:01

My application uses an UITextView. Now I want the UITextView to have a placeholder similar to the one you can set for an UITextField.<

30条回答
  •  失恋的感觉
    2020-11-22 16:08

    You can set the label on the UITextView by

    [UITextView addSubView:lblPlaceHoldaer];
    

    and hide it on TextViewdidChange method.

    This is the simple & easy way.

提交回复
热议问题