Я не могу понять, как правильно спроектировать нажатый элемент навигации viewcontrollers для RadioGroup.
Таким образом, на следующем экране, где можно выбрать язык, кнопка «Назад» говорит «Настройки» и имеет синий цвет. Но я хочу заставить его сказать обратно и изменить его дизайн, какие механизмы существуют и я уже использую в других экранах.
Я строю так:
var rootSettings = new RootElement ("Settings");
var sectionNotificationSettings = new Section ("Notification settings");
BooleanElement pushEnabled = new BooleanElement("Push notifications", settings.PushEnabled);
sectionNotificationSettings.Add(pushEnabled);
var sectionCountrySettings = new Section("Country settings");
var rootRadioGroup = new TransparentRootElement ("Language", new RadioGroup("languages", 0));
var sectionRadioElements = new Section("");
foreach(var language in settings.Languages)
{
RadioElement selectableLanguage = new RadioElement(language.Key, "languages");
sectionRadioElements.Add(selectableLanguage);
}
rootRadioGroup.Add(sectionRadioElements);
sectionCountrySettings.Add(rootRadioGroup);
rootSettings.Add (sectionNotificationSettings);
rootSettings.Add(sectionCountrySettings);
И здесь я определяю TransparentRootElement, где я думал, что могу редактировать элемент навигации:
public class TransparentRootElement : RootElement {
public TransparentRootElement (string caption) : base (caption)
{
}
public TransparentRootElement (string caption, Group radioGroup ) : base (caption, radioGroup)
{
}
public override void Selected (DialogViewController dvc, UITableView tableView, NSIndexPath path)
{
base.Selected (dvc, tableView, path, true);
}
void HandleMenuButtonTouchUpInside (object sender, EventArgs e)
{
_dvc.NavigationController.PopViewControllerAnimated(true);
}
public override UITableViewCell GetCell (UITableView tv)
{
var cell = base.GetCell (tv);
//cell.BackgroundColor = UIColor.White;
return cell;
}
}
Я пробовал много подходов к редактированию, но ни один из них не работал. Я также начал редактировать Elements.cs в Monotouch Dialog, но это тоже мне не очень помогло.
Кто-нибудь, у кого есть предложение?
Большое спасибо!