【问题标题】:Type ImageButton not found in xmlns Xamarin Forms在 xmlns Xamarin 表单中找不到类型 ImageButton
【发布时间】:2019-01-18 08:22:46
【问题描述】:

参考this documention

ImageButton 显示图像并响应点击或单击该图像 指示应用程序执行特定任务。

错误:在此代码中的 xmlns 中找不到类型 ImageButton:

<Grid>
        <ImageButton Source="XamarinLogo.png"
            HorizontalOptions="Center"
            VerticalOptions="CenterAndExpand" />
        <Image Source="word.png" Aspect="Fill"/>
    <Label HorizontalOptions="Fill" VerticalOptions="Fill" FontSize="20" TextColor="{Binding TextColor}"
    XAlign="Center" YAlign="Center" Text="{Binding Word}" BackgroundColor="{Binding BoxColor}"/>
</Grid>

【问题讨论】:

  • 您安装了哪个版本的 Xamarin.Forms? ImageButton 是最近添加的
  • @GeraldVersluis Xamarin.Forms 3.1.0.69729 和 Prism 7.1.0.172pre
  • 那就是问题所在。 ImageButton 是在 Xamarin.Forms 3.4 中引入的

标签: xamarin.forms imagebutton


【解决方案1】:

根据 cmets 推断,您使用的是旧版本的 Xamarin.Forms。你应该将你的包至少升级到 3.4 版本,这是 introduced ImageButton 控制的版本。

在这种情况下,Prism 版本并不重要。

【讨论】:

    【解决方案2】:

    ImageButton 仅在 Xamarin.Forms 3.4 中可用。

    检查您的版本,很可能是过时的并且 ImageButton 在较低版本中不可用

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-02-22
      • 1970-01-01
      • 1970-01-01
      • 2017-04-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多