MvvmCross 6.0 - TipCalc iOS Sample - Cannot get it

2019-05-22 23:06发布

问题:

I am very new to MvvmCross and Xamarin development. I am using MvvmCross 6.x

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.

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.

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.

What am I missing?

I am using Visual Studio 2017 on Windows. I cannot find the option to add a view controller with 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.

回答1:

Visual Studio remove viewController with xib template since 15.7.

If you still want to add viewcontroller like before, here is a workaround.

1.Add View Controller With Storyboard first,and remove the .Storyboard file.

2.Add .xib file and name it as your view controller.

3.Remove the code which initial viewcontroller in Storyboard way.

4.Click .xib class(blank area) and Link it to your viewcontroller.

  1. Open .xib with XML(Text)Editor way and add this code snippet under placeholder in order to create connection to the view.



回答2:

Right click -> Add -> New File and select the iOS tab and then select View Controller