MvvmCross 6.0 - TipCalc iOS Sample - Cannot get it

2019-05-22 23:07发布

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.

2条回答
该账号已被封号
2楼-- · 2019-05-22 23:20

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

Create xib

查看更多
Bombasti
3楼-- · 2019-05-22 23:34

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.

enter image description here

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

enter image description here

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

enter image description here

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

enter image description here

查看更多
登录 后发表回答