0

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 creating 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.

1 Answer 1

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.