Я не могу понять, как правильно спроектировать элемент навигации с заданными представлениями контроллеров 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, но это также не сильно помогло мне.
Кто-нибудь, у кого есть предложение?
Большое спасибо!