Hi everyone, I am struggle to find out the selected text index of a UITextView. In below pitcher I have select a some text and I am getting selected text but I want to know the that selected text index. Please give any idea. Thanks in advance.
Did you try UITextView.SelectedTextRange property?
Hi MihsMarkic, Thanks for spending time. I am actually try to get the index position not the text range otherwise is there way to get the index position from selected text range.
The UITextView.SelectedTextRange property mentioned by Miha Markic would be the correct way. The UITextView.SelectedTextRange property is of type UITextRange, and a UITextRange has a Start and an End property, so textView.SelectedTextRange.Start should give you the index for where the selection starts,
Xamarin Inc., as a wholly-owned Microsoft subsidiary acting as a separate legal entity, adheres to the Microsoft Privacy Statement: Privacy & cookies