Not able to remove default UImenuItem in UIWebView.

JayantaSarkarJayantaSarkar USMember, University

Hi,

I want to show only 'Copy' & 'Paste' menu item and all other like select,selectAll, delete want to remove. but it's not working.. allays all default menu comes. doing like below:
[Register("CustomUIWebView")]
public class CustomUIWebView : UIWebView
{
public CustomUIWebView(IntPtr handle) : base(handle)
{
}

public override bool CanPerform(Selector action, NSObject withSender)
{

    if(action.Name=="copy:" || action.Name=="paste:")
        return true;
    else
        false;

}

protected override void Dispose(bool disposing)
{
    base.Dispose(disposing);
}

public override bool CanBecomeFirstResponder { get { return true; } }

}
but nothing seems to be working...

Answers

  • rene_ruppertrene_ruppert DEXamarin Team, University, XamUProfessors Xamurai

    My standard question first: why would you want to do this? Maybe there's an alternative approach to what you are trying to achieve.

    Can you please provide a screenshot which shows the menus you'd like to eliminate?

    And next: have you tried debugging your code? Will it break into CanPerform()?

Sign In or Register to comment.