MvxListView在Android中使用MvvmCross [英] MvxListView in Android with MvvmCross

查看:239
本文介绍了MvxListView在Android中使用MvvmCross的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用MvvmCross v3和我有在Android中列表中的小问题。

I'm using MvvmCross v3 and I have a little problem with list in Android.

我其实有Mvx.MvxListView谁的作品很好,但我工作的平板电脑,和ListView有点inapropriate。所以我想有一个像WrapPannel控制在XAML中连续有多个项目。

I actually have a Mvx.MvxListView who works well, but I'm working on tablet, and ListView is a little bit inapropriate. So I want to have a control like WrapPannel in XAML to have more than one item in a row.

我怎么能有这种控制的?

How can I have this kind of control?

感谢

推荐答案

有两个挑战在这里:

首先是真的取决于你和你的UX /设计团队做的事情 - 尽管人们也许能够表明应用程序和可能有助于项目。当选择一个控制始终要认真了解它的内存使用 - 尤其是:

The first is really up to you and your UX/design team to do - although people might be able to suggest apps and projects which might help. When choosing a control always be careful to understand it's memory use - especially:


  • 是否virtualises的UI重用细胞(如列表一样)

  • 或者它是否会为每个项目的单元格,即使该项目是不可见的(如SL WrapPanel呢?)

这第二个步骤是一般很简单的事 - 看看在MVX布局控件之一,看看它是如何转化为数据绑定 - 例如<一href=\"https://github.com/slodge/MvvmCross/blob/v3/Cirrious/Cirrious.MvvmCross.Binding.Droid/Views/MvxLinearLayout.cs\" rel=\"nofollow\">https://github.com/slodge/MvvmCross/blob/v3/Cirrious/Cirrious.MvvmCross.Binding.Droid/Views/MvxLinearLayout.cs

This second step is generally quite simple to do - take a look at one of the Mvx layout controls and see how it is converted for databinding - e.g. https://github.com/slodge/MvvmCross/blob/v3/Cirrious/Cirrious.MvvmCross.Binding.Droid/Views/MvxLinearLayout.cs

您通常可以只剪切和粘贴此code到您的新类型。

You can generally just cut-and-paste this code over to your new type.

更多关于继承现有类型,也看到N的视频系列= 18 - http://slodge.blogspot.co.uk/2013/05/n18-android-custom-controls-n1-days-of.html - 这显示的子类的TextView

For more on subclassing existing types, also see N=18 in the video series - http://slodge.blogspot.co.uk/2013/05/n18-android-custom-controls-n1-days-of.html - this shows subclassing of a TextView

对于wrappanel,我做了previously适应并使用@ CheeseBaron的港口之一 - 的FlowLayout - 看的http://slodge.blogspot.co.uk/2013/01/an-mono-for-android-wrappanelflowlayout.html.然而,这并没有被更新v3的 - 如果你做的更新,这将会是巨大的,如果您共享结果反馈

For a wrappanel, I did previously adapt and use one of @CheeseBaron's ports - FlowLayout - see http://slodge.blogspot.co.uk/2013/01/an-mono-for-android-wrappanelflowlayout.html. However, this has not been updated for v3 - if you do update it, it'd be great if you shared the results back.

这篇关于MvxListView在Android中使用MvvmCross的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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