【发布时间】:2019-01-18 08:22:46
【问题描述】:
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 中引入的