在Xamarin iOS中 - 我有一個名爲TableCell (public class TableCell : UITableViewCell { })
的類 - 在這個類中我聲明瞭按鈕。在xamarin iOS中 - 在UITableViewCell中獲取[indexPath.Row],使用按鈕單擊事件
在按鈕單擊事件中,我試圖訪問[indexPath.Row]
在UITableViewCell
。我可以選擇一行以在UITableViewSource
中找到[indexPath.Row]
。
public class TableSource : UITableViewSource {
// - - - -
public override void RowSelected (UITableView tableView, NSIndexPath indexPath)
{
new UIAlertView("Row Selected", tableItems[indexPath.Row], null, "OK", null).Show();
tableView.DeselectRow (indexPath, true); // iOS convention is to remove the highlight
}
// - - - -
}
我怎樣才能在UITableViewCell
[indexPath.Row]
,使用按鈕單擊事件..?
嗨,我仍然通過你提供的代碼,並與一些新的類,我欣賞的幫助。謝謝,我們很快就會回來。 –
如果您需要更多幫助,請隨時與我聯繫:) – Roosevelt