0
當用戶單擊RootElement時,是否有正確的方法來使用Monotouch.Dialog(iOs)並調用UIViewController?我正在建立一個基於數組的數據頁面,點擊時我想打開這個自定義視圖並傳入數組元素..類似這樣的東西(不起作用)。任何幫助表示讚賞。Monotouch.Dialog RootElement打開UIViewController並傳入數據
RootElement CreateMenuCategory(JToken menucat) {
RootElement MenuCategory = new RootElement(menucat["menucategoryname"].Value<String>());
RootElement root_element;
Section section = new Section();
foreach(JToken menuitem in menucat["menuitems"]) {
root_element = new RootElement(menuitem["menuitemname"].Value<String>(), (RootElement e) => {
return _menuitemView.LoadMenuItem(menuitem); // menuitem on view is always the same
});
section.Add (root_element);
}
MenuCategory.Add (section);
return MenuCategory;
}
該代碼不起作用,因爲委託始終每次都傳遞相同的元素。
工作就像一個魅力..謝謝。 – lucuma