2013-08-14 2 views

ответ

0

Я думаю вы имеете в виду мобильный аксессуар HtmlElement в MonoTouch.Dialog. Эта гибкость, похоже, не включена в реализацию, но ее легко добавить.

Перейти к: MonoTouch.Dialog Github Source (Elements.cs)

Скопируйте определение класса HtmlElement (строки 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.

0

Вы пытались создать подкласс 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 Simulator 6.1.

Смежные вопросы