【问题标题】:How to design a "View" in Xamarin Forms如何在 Xamarin Forms 中设计“视图”
【发布时间】:2019-02-11 14:29:24
【问题描述】:

我在 Xamarin android 中有一个 XAML 设计,我想在 Xamarin 表单中使用它。 我怎么能那样做? 这是我在 Xamarin android 中的 XAML 代码:

<view xmlns:android="http://schemas.android.com/apk/res/android"
class="mono.samples.notepad.LinedEditText"
android:id="@+id/note"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="5dip"
android:scrollbars="vertical"
android:fadingEdge="vertical"
android:gravity="top"
android:textSize="22sp"
android:capitalize="sentences"
/>

【问题讨论】:

标签: xaml xamarin.forms xamarin.android


【解决方案1】:

这不是 XAML,这是 XML。在 Xamarin.Forms 中没有直接的方法来支持 Android XML 布局(这是有道理的,因为它们不能在 iOS 上工作)。您可以尝试使用一些自定义渲染来做到这一点,但这些只能在 Android 上运行。

【讨论】:

    【解决方案2】:

    我在 Xamarin android 中有一个 XAML 设计,我想在 Xamarin 表单中使用它 我怎么能那样做?

    Android XMLXamarin Xaml不一样,都是XML的不同规范,不能互相替代。

    这是我在 Xamarin android 中的 XAML 代码:

    正如您在上面阅读的那样,这是 XML 而不是 XAML,我还建议在上面复制一个,看看它是否适合您

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-01-14
      • 2016-10-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多