hi all,
i want to set cursor at the beginning position for xamarin forms search bar after search bar text is filled.
example:
mysearchbar.text="Hello";
now i want to set Position of Cursor of mysearchbar at beginning(starting ) of it.
any solution?
thanks in advance
Answers
You would need custom renderer to do this stuff .
Step 1 : Find the entry(EditText in android, UITextField in iOS) inside the searchbar .
Step 2 : Assign the text change event, set cursor position .
Android:
iOS
Can you please suggest me the xamarin form changes also?
Is that possible only through custom renderer?
Yes.
I can understand that you have suggested above!, but i need complete solution, suggest me the form changes also
No changes in Forms project ,just put SearchBar normally in Page.Xaml
Thanks for that!,
I am not clear here,
int id = Control.Resources.GetIdentifier("android:id/search_src_text", null, null);
How to get the id then!
Am using AutoComplete Custom Search bar control!