Xamarin Forms ListView with Image | Text | Time

五迷三道 提交于 2019-12-24 04:29:17

问题


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)


回答1:


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.



来源:https://stackoverflow.com/questions/49535781/xamarin-forms-listview-with-image-text-time

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!