您的位置:首页 > 产品设计 > UI/UE

UiTextView的提示文字效果

2015-11-09 20:27 471 查看
#pragma mark ----textView delegate
-(BOOL) textViewShouldBeginEditing:(UITextView *)textView
{
if(textView.tag == 0) {
textView.text = @"";
textView.textColor = [UIColor colorWithHex:0x666666 alpha:1];
textView.tag = 1;
}
return YES;
}

-(void)textViewDidEndEditing:(UITextView *)textView
{
if([textView.text length] == 0)
{
textView.text = @"文章内容";
textView.textColor = [UIColor colorWithHex:0xe1e1e1 alpha:1];
textView.tag = 0;
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: