0

When the UITextView's content is too much, the location of the cursor is in the middle rather than at the beginning. I want to start from the beginning rather than starting from the middle.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
zyj
  • 61
  • 3

1 Answers1

0

Try this, [yourTextView setSelectedTextRange:[yourTextView textRangeFromPosition:requiredCursorPosition toPosition:requiredCursorPosition]];

For more refer: https://stackoverflow.com/a/11532718/3743322

Community
  • 1
  • 1
Alex Andrews
  • 1,498
  • 2
  • 19
  • 33
  • -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; CGFloat contentHeight = self.textView.contentSize.height; CGFloat offSet = self.textView.contentOffset.x; CGFloat contentOffset = contentHeight - offSet; self.textView.contentOffset = CGPointMake(0, -contentOffset); I solved it by this ,thank you anymore – zyj Sep 21 '15 at 05:33