我试图运行NPlus1DaysOfMvvmCross N = 24 SplitView教程。
在iphone模拟器下工作正常。按钮导航到红色和蓝色视图,但它们看起来与视频(无边框)看起来完全相同。
在ipad下我只是在mvvmcross启动后出现灰色屏幕。
输出看起来没问题,我已通过调试验证它正在创建演示者:
protected override IMvxTouchViewPresenter CreatePresenter()
{
if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
return new SplitPresenter(_window);
return base.CreatePresenter();
}
如何解决问题所在?
Starting iPad Retina simulator 7.1
Launching application
Application launched. PID = 23709
Press enter to terminate the application
Loaded assembly: /Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll [External]
Loaded assembly: /Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll [External]
Loaded assembly: /Developer/MonoTouch/usr/lib/mono/2.1/System.dll [External]
Thread started: #2
Loaded assembly: /Users/mike/NPlus1DaysOfMvvmCross/N-24-Split/Splitter.Touch/bin/iPhoneSimulator/Debug/SplitterTouch.exe
Loaded assembly: /Users/mike/NPlus1DaysOfMvvmCross/N-24-Split/packages/MvvmCross.HotTuna.CrossCore.3.1.1-beta2/lib/MonoTouch/Cirrious.CrossCore.dll [External]
Loaded assembly: /Users/mike/NPlus1DaysOfMvvmCross/N-24-Split/packages/MvvmCross.HotTuna.MvvmCrossLibraries.3.1.1-beta2/lib/MonoTouch/Cirrious.MvvmCross.Touch.dll [External]
Loaded assembly: /Users/mike/NPlus1DaysOfMvvmCross/N-24-Split/packages/MvvmCross.HotTuna.MvvmCrossLibraries.3.1.1-beta2/lib/MonoTouch/Cirrious.MvvmCross.dll [External]
Loaded assembly: /Users/mike/NPlus1DaysOfMvvmCross/N-24-Split/packages/MvvmCross.HotTuna.CrossCore.3.1.1-beta2/lib/MonoTouch/Cirrious.CrossCore.Touch.dll [External]
Loaded assembly: /Users/mike/NPlus1DaysOfMvvmCross/N-24-Split/packages/MvvmCross.HotTuna.CrossCore.3.1.1-beta2/lib/MonoTouch/Cirrious.MvvmCross.Binding.dll [External]
Loaded assembly: /Developer/MonoTouch/usr/lib/mono/2.1/Mono.Dynamic.Interpreter.dll [External]
Loaded assembly: /Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll [External]
Loaded assembly: /Developer/MonoTouch/usr/lib/mono/2.1/System.Windows.dll [External]
Loaded assembly: /Users/mike/NPlus1DaysOfMvvmCross/N-24-Split/packages/MvvmCross.HotTuna.CrossCore.3.1.1-beta2/lib/MonoTouch/Cirrious.MvvmCross.Localization.dll [External]
Loaded assembly: /Users/mike/NPlus1DaysOfMvvmCross/N-24-Split/packages/MvvmCross.HotTuna.CrossCore.3.1.1-beta2/lib/MonoTouch/Cirrious.MvvmCross.Binding.Touch.dll [External]
Loaded assembly: /Users/mike/NPlus1DaysOfMvvmCross/N-24-Split/Splitter.Core/bin/Debug/Splitter.Core.dll [External]
2014-07-08 15:11:52.913 SplitterTouch[23709:70b] mvx: Diagnostic: 0.00 Setup: PlatformServices start
2014-07-08 15:11:52.928 SplitterTouch[23709:70b] mvx: Diagnostic: 0.04 Setup: MvvmCross settings start
2014-07-08 15:11:52.929 SplitterTouch[23709:70b] mvx: Diagnostic: 0.04 Setup: Singleton Cache start
2014-07-08 15:11:52.930 SplitterTouch[23709:70b] mvx: Diagnostic: 0.04 Setup: Bootstrap actions
2014-07-08 15:11:52.938 SplitterTouch[23709:70b] mvx: Diagnostic: 0.05 Setup: StringToTypeParser start
2014-07-08 15:11:52.940 SplitterTouch[23709:70b] mvx: Diagnostic: 0.05 Setup: ViewModelFramework start
2014-07-08 15:11:52.941 SplitterTouch[23709:70b] mvx: Diagnostic: 0.05 Setup: PluginManagerFramework start
2014-07-08 15:11:52.942 SplitterTouch[23709:70b] mvx: Diagnostic: 0.05 Setup: App start
2014-07-08 15:11:52.960 SplitterTouch[23709:70b] mvx: Diagnostic: 0.07 Setup: ViewModelTypeFinder start
2014-07-08 15:11:52.962 SplitterTouch[23709:70b] mvx: Diagnostic: 0.07 Setup: ViewsContainer start
2014-07-08 15:11:52.963 SplitterTouch[23709:70b] mvx: Diagnostic: 0.07 Setup: ViewDispatcher start
2014-07-08 15:11:52.963 SplitterTouch[23709:70b] mvx: Diagnostic: 0.08 Setup: Views start
2014-07-08 15:11:52.976 SplitterTouch[23709:70b] mvx: Diagnostic: 0.09 Setup: CommandCollectionBuilder start
2014-07-08 15:11:52.977 SplitterTouch[23709:70b] mvx: Diagnostic: 0.09 Setup: NavigationSerializer start
2014-07-08 15:11:52.978 SplitterTouch[23709:70b] mvx: Diagnostic: 0.09 Setup: InpcInterception start
2014-07-08 15:11:52.978 SplitterTouch[23709:70b] mvx: Diagnostic: 0.09 Setup: LastChance start
2014-07-08 15:11:52.999 SplitterTouch[23709:70b] mvx: Diagnostic: 0.11 Setup: Secondary end
2014-07-08 15:11:53.000 SplitterTouch[23709:70b] mvx: Diagnostic: 0.11 Showing ViewModel FirstViewModel
2014-07-08 15:11:53.002 SplitterTouch[23709:70b] TouchNavigation: Diagnostic: 0.11 Navigate requested
答案 0 :(得分:0)
我通过使用每个SplitPresenter.Show()请求创建一个新的SplitViewController来实现它
public override void Show(Cirrious.MvvmCross.ViewModels.MvxViewModelRequest request)
{
var viewController = (UIViewController)Mvx.Resolve<IMvxTouchViewCreator>().CreateView(request);
if (request.ViewModelType == typeof(FirstViewModel))
left = viewController;
else
right = viewController;
_window.RootViewController = new SplitViewController ( left, right );
}
这里有完整的例子: https://github.com/mribbons/NPlus1-N-24-SplitView
我不确定这是不是坏(tm)。
答案 1 :(得分:0)
我们是否有关于此问题的解决方案的更多信息?从N + 1教程运行解决方案时,我也遇到了灰屏问题。当我运行Michael Robbins发布的解决方案时,我也得到一个灰色的屏幕。