如何使用 MvvmCross 在 MonoTouch 中实现带有分组表的视图,所以你会得到这样的结果:
http://www.yetanotherchris.me/storage/downloads/UITableViewController.png
现在我有这段代码,但我无法将 UITableViewStyle 更改为 Grouped:
public partial class HomeView : MvxBindingTouchTableViewController<HomeViewModel>
{
public HomeView(MvxShowViewModelRequest request)
: base(request)
{
}
public override void ViewDidLoad()
{
base.ViewDidLoad();
NavigationItem.SetRightBarButtonItem(new UIBarButtonItem("History", UIBarButtonItemStyle.Bordered, (sender, e) => ViewModel.DoGoToHistory()), false);
var source = new MvxActionBasedBindableTableViewSource(
TableView,
UITableViewCellStyle.Value1,
new NSString("HomeView"),
"{'TitleText':{'Path':'Date'},'DetailText':{'Path':'Location'},'SelectedCommand':{'Path':'ViewDetailCommand'}}",
UITableViewCellAccessory.DisclosureIndicator);
this.AddBindings(
new Dictionary<object, string>()
{
{ source, "{'ItemsSource':{'Path':'List'}}" },
{ this, "{'Title':{'Path':'TestTitle'}}"}
});
TableView.Source = source;
TableView.ReloadData();
}
}
有谁知道该怎么做?