问题描述
我对MvvmCross和Xamarin开发非常陌生.我正在使用MvvmCross 6.x
I am very new to MvvmCross and Xamarin development. I am using MvvmCross 6.x
我遵循了TipCalc教程,并且能够设置核心项目,但是,当我尝试设置iOS项目时,我在Windows的Visual Studio 2017中找不到任何可添加带有xib文件的View Controller的项目.
I followed the TipCalc tutorial and I was able to setup the core project, but, when I tried to setup the iOS project, I did not find any item to add View Controller with xib file in Visual Studio 2017 on Windows.
我看到的唯一选项是在用户界面下添加带有故事板,视图控制器类和uiview的视图控制器,但没有添加带有xib的视图控制器的项目.
Only options I see is to add a view controller with story board, view controller class and uiview, but no item to add view controller with xib, under user interface.
我尝试使用情节提要添加视图,并使用MvxFromStoryboard属性装饰了该类,但是在运行该应用程序时该视图不显示.
I tried to add view with a storyboard and decorated the class with MvxFromStoryboard attribute, but the view does not show when I run the app.
我想念什么?
我在Windows上使用Visual Studio 2017.我找不到使用xib添加视图控制器的选项.
I am using Visual Studio 2017 on Windows. I cannot find the option to add a view controller with xib.
我看到的唯一选项是在用户界面下添加带有故事板,视图控制器类和uiview的视图控制器,但没有添加带有xib的视图控制器的项目.
Only options I see is to add a view controller with story board, view controller class and uiview, but no item to add view controller with xib, under user interface.
推荐答案
从15.7
开始,Visual Studio使用xib模板删除viewController.
Visual Studio remove viewController with xib template since 15.7
.
如果您仍然想像以前一样添加viewcontroller,这是一种解决方法.
If you still want to add viewcontroller like before, here is a workaround.
1.首先添加View Controller With Storyboard
,然后删除.Storyboard
文件.
1.Add View Controller With Storyboard
first,and remove the .Storyboard
file.
2.添加.xib
文件并将其命名为视图控制器.
2.Add .xib
file and name it as your view controller.
3.以Storyboard方式删除初始viewcontroller的代码.
3.Remove the code which initial viewcontroller in Storyboard way.
4.单击.xib
类(空白区域)并将其链接到您的视图控制器.
4.Click .xib
class(blank area) and Link it to your viewcontroller.
- 以
XML(Text)Editor
方式打开.xib
,并在placeholder
下添加此代码段,以创建与视图的连接.
- Open
.xib
withXML(Text)Editor
way and add this code snippet underplaceholder
in order to create connection to the view.
这篇关于MvvmCross 6.0-TipCalc iOS示例-无法正常运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!