【问题标题】:Can't add Label on Image with using Xamarin.forms?无法使用 Xamarin.forms 在图像上添加标签?
【发布时间】:2016-11-05 07:12:24
【问题描述】:

我正在使用 Xamarin.forms 制作 iOS 和 Android 应用程序。

我不能在图片上添加标签吗?

我当然知道使用许多布局样式。 但这个问题正是我想问的。

【问题讨论】:

    标签: xamarin xamarin.forms


    【解决方案1】:

    不,你不能。

    Xamarin.Forms Image 没有 Text 属性。

    唯一的选择是使用ImageLabel 或为此创建CustomView


    ImageCellCell 的一种类型,用于List。使用单行表格可以为您提供所需的视觉效果,但这并不是一个好的解决方案。

    仅限Android 注意:Android 上,Label 可以有,Drawable 在左、右、上和下。因此,如果您只定位 Android,您可以为添加图像的 Label 自定义渲染。

    【讨论】:

    • 谢谢@jzeferino!
    猜你喜欢
    • 2017-02-16
    • 2019-07-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-24
    • 2016-10-18
    • 1970-01-01
    • 2020-01-22
    相关资源
    最近更新 更多