MvvmCross: How do I use the MvxTableViewController

2019-08-09 22:25发布

问题:

I don't see the constructor that takes a nibname for the MvxTableViewController. I do see it for MvxViewController.

回答1:

The nib-based constructor isn't currently exposed by MvvmCross - so you can only currently do this by:

  • forking the source code and building your own copy
  • copying the source code into your own classes and using those - this isn't a big chore - you'd just need your own copies of:
    • https://github.com/slodge/MvvmCross/blob/v3/Cirrious/Cirrious.MvvmCross.Touch/Views/MvxTableViewController.cs
    • https://github.com/slodge/MvvmCross/blob/v3/CrossCore/Cirrious.CrossCore.Touch/Views/MvxEventSourceTableViewController.cs

Obviously you can also just use a regular MvxViewController with a Nib that just contains a single UITableView