【问题标题】:How to access string values from Table View in Xamarin如何从 Xamarin 中的表视图访问字符串值
【发布时间】:2013-08-18 18:34:45
【问题描述】:

How to populate view in Xamarin 开始,我可以使用一堆字符串设置表格视图,但是如何访问用户选择的字符串值?我知道在上一个问题中,我必须重写一些方法来填充表格视图。我必须这样做才能访问字符串值吗?如果是这样,我需要重写哪个方法?

【问题讨论】:

    标签: c# string macos cell xamarin


    【解决方案1】:

    解决了我的问题。花了一些时间才弄清楚,但需要做的是:

    1. Go to the .xib file in Xcode.
    2. Double or triple click the inner cell to get the cell isolated.
    3. Connect that cell to the controller file or the .h file in Xcode. 
    4. Save. 
    
    1. Then go to Xamarin.
    2  Use use the table view object, which in my case is `tableview`
    3. Set the object's `Cell` property to the the `NSTextFieldCell` object. `tableview.Cell = yourNSTextfieldObject`
    4. To get the string value: `tableview.Cell.StringValue`
    

    【讨论】:

      猜你喜欢
      • 2021-12-01
      • 2012-12-24
      • 1970-01-01
      • 1970-01-01
      • 2021-08-08
      • 1970-01-01
      • 2011-02-22
      • 2012-08-21
      • 1970-01-01
      相关资源
      最近更新 更多