Xamarin形成具有图像的ListView |文字|时间 [英] Xamarin Forms ListView with Image | Text | Time

查看:70
本文介绍了Xamarin形成具有图像的ListView |文字|时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用xamarin表单来构建混合应用程序. 我正在尝试建立一个显示带有图标和时间戳的错误的列表视图.

这是我想重塑为xamarin形式的概念设计. 我曾使用ImageCell尝试使图标带有一些文本,但现在我想在图标上方(或文本旁边,PO不确定)添加第三个元素(时间)

解决方案

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

是这样的:

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

添加所需的其他属性以及绑定,单元格即可使用.

I am currently working with xamarin forms to build a hybrid app. I am trying to build a listview that displays an error with an icon and a timestamp.

This is the concept design I want to remake into xamarin forms. I used an ImageCell to try and get the icon with some text working but now that I want to add a third element (the time) above the icon (or next to the text, the PO is not sure about that)

解决方案

As @Jason said, you should use a ViewCell.

It would be like this:

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

Add the other properties you need and your bindings and the cell is ready to use.

这篇关于Xamarin形成具有图像的ListView |文字|时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆