开发者

How to stick the cursor position on the left corner in UITextView?

I know this could be funable question , but still i'm getting problem in that as i'm new to iphone. Problem -> Actually i'm creat开发者_JS百科ing custom textview in the cell and taking view up and down when keyboard appears. So problem i'm getting is when textViewShouldBeginEditing calls and my view up's the cursor of the textview also up and hides the cursor, i'm unable to see the text which i wrote in the textview. i am writing this code in the UITableView:

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];

So please help me to solve this problem ,,, thanks in advance.


Try adding the UITextView as an accessory view, rather than as a content view. Something like this:

[cell setAccessoryView:_RepliesPost];

This remains visible when editing. I also prefer to set my UITextView Alignment to UITextAlignmentRight when doing this, as it looks the most aesthetically pleasing.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜