How to Add the “Select All” option after long tapping a UITextView in xamarin.ios. Its only show Copy, Look Up, Share...
but we want select all option without Editable mode.
Please help/guide to solve this..
@sumitmishra The default setting is when you select one or more words in the TextView, the UIMenuController will hide Select All option. This tab will show up when TextView's text hasn't been selected(only show up a cursor) and user taps the TextView again. But we can change the default setting by overriding the CanPerform() event. Customize your own TextView like:
public partial class MyTextView : UITextView
public MyTextView (IntPtr handle) : base (handle)
public override bool CanPerform(Selector action, NSObject withSender)
if (action == new Selector("selectAll:"))
return base.CanPerform(action, withSender);
How to implement this code that you suggested. We have textview in tableview cell in a viewController. Please guide..
@sumitmishra The code above customize a UITextView. Just replace your textview in the cell to this MyTextView.
Hi @LandLu ,
We have implemented as you suggested, but its throw compile time error that "CanPerform(Selector action, NSObject withSender) : no suitable method found to override ". Please check screen shot.
@sumitmishra Did you just copy my code to your class? Try to type it yourself, it may be the ide's issue.
Thank you very much @LandLu . Its work.
Xamarin Inc., as a wholly-owned Microsoft subsidiary acting as a separate legal entity, adheres to the Microsoft Privacy Statement: Privacy & cookies