xamarin.forms - 在 xmlns Xamarin 表单中找不到类型 ImageButton
问题描述
参考这个文档
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。您应该将您的包至少升级到版本 3.4,这是引入该ImageButton
控件的版本。
在这种情况下,棱镜版本并不重要。
推荐阅读
- css - 将元素放置在“闪亮”应用程序中,以便它们调整移动和桌面显示器的大小
- ios - 将 Powerapps 投射到 Chromecast
- solr - 分片处于“恢复”状态,副本都处于“活动状态”
- postgresql - 在 Postgresql 中删除字符
- apache-spark - 如何将带有时区的奇怪日期时间字符串转换为时间戳(PySpark)
- android - 如何在Android上的recyclerView中使用多个计时器
- android - 调试输出上的 Android net::ERR_CACHE_MISS
- python - 暂停 Jupyter Notebook 小部件,等待用户输入
- xaml - xamarin.forms 汉堡包图标
- python - 用熊猫读取具有可变列数的csv