2011-07-22 60 views
0

我知道这可能是有趣的问题,但我仍然遇到问题,因为我是新来的iphone。 问题 - >实际上,我在单元格中创建了自定义textview,并在出现键盘时上下查看。所以,我得到的问题是,当textViewShouldBeginEditing调用,我的视图上的文本视图的光标也隐藏了光标,我无法看到我在textview中写的文本。 我在UITableView的编写这些代码:如何将光标位置贴在UITextView的左上角?

UITextView *_RepliesPost = [[UITextView alloc] initWithFrame:CGRectMake(5, 2, 260, 32)]; 
       _RepliesPost.textAlignment = UITextAlignmentLeft; 
       _RepliesPost.font = [UIFont fontWithName:@"Helvetica neue" size:6.00]; 
       _RepliesPost.font = [UIFont boldSystemFontOfSize:10]; 
       _RepliesPost.tag=15; 
       _RepliesPost.delegate=self; 
       _RepliesPost.backgroundColor = [UIColor whiteColor]; 
       _RepliesPost.textColor = [UIColor blackColor]; 
       [cell.contentView addSubview:_RepliesPost]; 

所以,请帮我解决这个问题,,,在此先感谢。

回答

0

尝试添加UITextView作为附件视图,而不是内容视图。事情是这样的:

[cell setAccessoryView:_RepliesPost];

这仍然可见当编辑。我也喜欢在做这个时将我的UITextView对齐设置为UITextAlignmentRight,因为它看起来最美观。

相关问题