public virtual nfloat GetHeightForSpecifier(UITableView tableView, SettingsSpecifier specifier) { if (specifier.Key == "customCell") { return(44 * 3); } return(0); }
public virtual UITableViewCell GetCellForSpecifier(UITableView tableView, SettingsSpecifier specifier) { var cell = (CustomViewCell)tableView.DequeueReusableCell(specifier.Key); if (cell == null) { cell = NSBundle.MainBundle.LoadNib("CustomViewCell", this, null).GetItem <CustomViewCell> (0); cell.TextView.Changed += delegate { NSUserDefaults.StandardUserDefaults.SetString(cell.TextView.Text, "customCell"); NSNotificationCenter.DefaultCenter.PostNotificationName(SettingsStore.AppSettingChangedNotification, (NSString)"customCell"); }; } var text = NSUserDefaults.StandardUserDefaults.StringForKey(specifier.Key) ?? specifier.DefaultStringValue; cell.TextView.Text = text; cell.SetNeedsLayout(); return(cell); }
public virtual void ButtonTappedForSpecifier(AppSettingsViewController sender, SettingsSpecifier specifier) { Console.WriteLine("Settings button tapped: " + specifier.Key); }