c# - Xamarin 形成带有图像的 ListView |文字 |时间

标签 c# xaml xamarin xamarin.forms hybrid

我目前正在使用 xamarin 表单构建混合应用程序。 我正在尝试构建一个 ListView ,它显示带有图标和时间戳的错误。

这是我想重新制作成 xamarin 形式的概念设计。 我使用了 ImageCell 来尝试让带有一些文本的图标正常工作,但现在我想在图标上方(或文本旁边)添加第三个元素(时间),PO 不确定关于那个)

enter image description here

最佳答案

正如@Jason 所说,您应该使用ViewCell

应该是这样的:

<ViewCell>
    <StackLayout Orientation="Horizontal">
        <StackLayout>
            <Label HorizontalOptions="Center"
                   HorizontalTextAlignment="Center"/>
            <Image >
        </StackLayout>
        <Label VerticalOptions="FillAndExpand"
               VerticalTextAlignment="Center"
               HorizontalOptions="FillAndExpand"/>
    </StackLayout>
</ViewCell>

添加您需要的其他属性和绑定(bind),单元格就可以使用了。

关于c# - Xamarin 形成带有图像的 ListView |文字 |时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49535781/

相关文章:

c# - MySQL 访问拒绝 C# 应用程序但不访问工作台

c# - 用c#画形状

c# - 如何让 WPF 验证冒泡到父控件?

xamarin - 在 Xamarin Android 中单击按钮来调用 Xamarin.Forms.Page?

C# 图片框.图像

c# - 如何在 ASP 中测试 AccountController?

c# - 如何在 wpf datagrid 中获取所选单元格的行标题值?

c# - 如何实现延迟位图加载?

c# - 如何在 .NET Core 中使用 xUnit 测试 Xamarin ViewModel?

forms - Xamarin Shell 引发歧义路由匹配异常