Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/277.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在xamarin.ios/monotouch上隐藏UIWebView的InputAccessoryView?_C#_Ios_Uiwebview_Xamarin.ios_Xamarin - Fatal编程技术网

C# 如何在xamarin.ios/monotouch上隐藏UIWebView的InputAccessoryView?

C# 如何在xamarin.ios/monotouch上隐藏UIWebView的InputAccessoryView?,c#,ios,uiwebview,xamarin.ios,xamarin,C#,Ios,Uiwebview,Xamarin.ios,Xamarin,在Xamarin.ios/monotouch上是否有隐藏或替换UIWebView的InputAccessoryView的方法?我想你指的是monotouch.Dialog中HtmlElement的单元格附件。这种灵活性似乎没有包含在实现中,但很容易添加 转到: 复制HtmleElement类定义(撰写本文时的第527行到第640行),并将其重命名为WhateverYouWantElement。修改GetCell方法: public override UITableViewCell GetCel

在Xamarin.ios/monotouch上是否有隐藏或替换UIWebView的InputAccessoryView的方法?

我想你指的是monotouch.Dialog中HtmlElement的单元格附件。这种灵活性似乎没有包含在实现中,但很容易添加

转到:

复制HtmleElement类定义(撰写本文时的第527行到第640行),并将其重命名为WhateverYouWantElement。修改GetCell方法:

public override UITableViewCell GetCell (UITableView tv)
{
...
static NSString hkey = new NSString ("WhateverYouWantElement"); //very important to set a unique cell reuse identifier here!
...
cell.Accessory = UITableViewCellAccessory.None;
...
}

这将创建一个没有公开指示符的单元格。重用标识符将确保与内置HtmlElement没有冲突。

您是否尝试过创建
UIWebView
的子类并重写其
InputAccessoryView
属性以使其返回
null

private class CustomWebView : UIWebView
     
{
            
    public override UIView InputAccessoryView
    
    {
                
        get
                  
        {
                    
            return null;
                
        }
            
    }
        
}
     

public override void ViewDidLoad()
 
{
            
    base.ViewDidLoad();

    // Perform any additional setup after loading the view, typically from a nib.            
        RectangleF frame = new RectangleF(0, 0, 200, 30);
            
            

    UITextField txfTest = new UITextField();
            
    txfTest.Frame = frame;
            
    txfTest.BorderStyle = UITextBorderStyle.RoundedRect;
            
    txfTest.Placeholder = "Click here";
            
    txfTest.EditingDidBegin += (object sender, EventArgs e) => {
                    
        // do something
            
    };

    CustomWebView webView = new CustomWebView();
            
    webView.LoadRequest(new NSUrlRequest(new NSUrl(@"http://google.com")));
            
    webView.Frame = new RectangleF(0, 100, 320, 480);
            
            
    webView.AddSubview(txfTest);            
            

    this.View.AddSubview(webView);
        
}
我试图将
UITextField
添加到
UIWebView
中,但在聚焦
UITextField
后,没有显示输入附件。我正在使用IPhone模拟器6.1。