【问题标题】:Xamarin.Forms Tablet and PhoneXamarin.Forms 平板电脑和手机
【发布时间】:2014-11-22 03:04:25
【问题描述】:

有没有人看过 Xamarin.Forms 代码示例,该示例支持平板电脑和手机 UI,而无需对片段进行依赖注入?

我想利用屏幕空间,到目前为止,我已经使用 ContentView -> ViewModel 架构构建了整个应用程序,但我似乎找不到任何专门处理通用 UI 的示例 Xamarin.Forms 代码。

【问题讨论】:

    标签: xamarin.forms


    【解决方案1】:

    How to create a tablet UI with multiple ContentPages on one screen at the same time with Xamarin.Forms?

    它的要点是创建基于ContentView 的 UI 实现,然后决定是否将它们单独显示在 ContentPage 中(在手机上),或者将它们中的两个或多个一起显示在单个 ContentPage 中(在平板电脑上)。

    您还可以利用 [OnPlatform][1] 以声明方式在两者之间进行选择。

    【讨论】:

    • 这就是我正在做的。我缺少的部分是实际实现的示例。我想我会在 git 中添加一些。谢谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-20
    • 2018-05-10
    • 1970-01-01
    • 1970-01-01
    • 2017-12-01
    • 2017-03-06
    相关资源
    最近更新 更多