iphone自定义UITextView的placeholder(2)
来源:未知 责任编辑:责任编辑 发表时间:2014-02-18 03:21 点击:次
p> p>在ViewController中用时,1、在xib上加一个uitextview连接上,2、直接创建initframe p> p>但是不要忘了,placeholder,和添加通知,移除通知。 p> p> p>
- (void)viewDidLoad { [super viewDidLoad]; self.textView.placeholder = @"请添写你的信息……"; // Do any additional setup after loading the view, typically from a nib. } -(void)viewDidAppear:(BOOL)animated { [super viewDidAppear:YES]; [self.textView addObserver]; } -(void)viewDidDisappear:(BOOL)animated { [super viewDidDisappear:YES]; [self.textView removeobserver]; } - (void)viewDidLoad { [super viewDidLoad]; self.textView.placeholder = @"请添写你的信息……"; // Do any additional setup after loading the view, typically from a nib. } -(void)viewDidAppear:(BOOL)animated { [super viewDidAppear:YES]; [self.textView addObserver]; } -(void)viewDidDisappear:(BOOL)animated { [super viewDidDisappear:YES]; [self.textView removeobserver]; }
p> p> p> p> p>效果图: p> p> p> p> p> p> p>
相关新闻>>
- 发表评论
-
- 最新评论 更多>>