Xamarin形成具有图像的ListView |文字|时间 [英] Xamarin Forms ListView with Image | Text | Time
问题描述
我目前正在使用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屋!