【问题标题】:iOS and WP Blank app not rendered in Xamarin Forms PCLiOS 和 WP Blank 应用程序未在 Xamarin Forms PCL 中呈现
【发布时间】:2014-11-06 04:32:35
【问题描述】:

iOS 和 WP Blank 应用程序未在 Xamarin Forms PCL 中呈现。

我已将我的自定义控件映射到以下项目结构中的 PCL 中。

Control.XForms.
Control.XForms.Android
Control.XForms.iOS
Control.XForms.WindowsPhone

并通过附加上述 dll 为 Xamarin(便携式)创建另一个空白应用程序。(在下面的项目结构中)

Sample.XForms
Sample.XForms.Android
Sample.XForms.iOS
Sample.XForms.Windows.Phone.

我在 App.Xaml 中的 Sample.XForms 中有我的应用程序代码,并在其中添加了 Control.XForms.dll

并添加了Control.XForms.Android.dll,Control.XForms.dll and customControl.dll,对于其他平台也是如此。

仅在 Android 中呈现的示例,在其他平台上显示为空屏。

我错过了什么吗?

任何建议都会有所帮助。

提前致谢。

【问题讨论】:

    标签: xamarin.ios xamarin xamarin.forms


    【解决方案1】:

    可能没有加载程序集,我在 iOS 和 Windows Phone 上也遇到了同样的问题。 我通过在 WP 和 iOS 项目的启动页面中加载渲染器来加载程序集来解决它。例如在 iOS 中的 AppDelegate 中:

     public override bool FinishedLaunching(UIApplication app, NSDictionary options)
     {
         new CustomControlRenderer(); //include assembly
    
         // Any other FinishedLaunching code here..
     }
    

    我希望这能解决你的问题。

    【讨论】:

      猜你喜欢
      • 2021-05-09
      • 1970-01-01
      • 1970-01-01
      • 2019-01-19
      • 1970-01-01
      • 2017-01-27
      • 2022-10-18
      • 2021-05-13
      • 1970-01-01
      相关资源
      最近更新 更多