Does MVVMCross support ActionBar?

人盡茶涼 提交于 2019-12-10 10:29:32

问题


I was doing a quick experiment and I was wondering if I have to use MvxTabsFragmentActivity or is it possible to do this using the standard ActionBar logic? I tried to implement it but if I do something similar to this example I get issues with MvxFragment not being able to be converted to Android.App.Fragment.

I was researching this a little and it may be due to a namespace conflict with the v4 support library. Can anyone shed any light on this?

Is MvxTabsFragmentActivity Android's "old" way of doing tabs?


回答1:


Is MvxTabsFragmentActivity Android's "old" way of doing tabs?

No - Android's old way of doing tabs is using Activities

MvxFragment not being able to be converted to Android.App.Fragment

MvxFragment is based on the support library's Fragment implementation, allowing use back to Android 2.x

You can read more about this support library at http://developer.android.com/tools/support-library/index.html and there's an intro to the mvx fragment implementation at http://slodge.blogspot.co.uk/2013/06/n26-fragments-n1-days-of-mvvmcross.html

Xamarin's support for the support lib is documented in http://docs.xamarin.com/guides/android/platform_features/fragments/part_4_-_providing_backwards_compatibility_with_the_android_support_package

However, there seems to be some problem with Xamarin supporting the latest version - see http://forums.xamarin.com/discussion/7018/xamarin-support-for-the-new-july-2013-revision-18-v7-compatibility-library for discussion and possible alternatives - from my reading on that thread, Xamarin's suggestion seems to be to use ActionBarSherlock - although I'd also consider LegacyBar



来源:https://stackoverflow.com/questions/18474183/does-mvvmcross-support-actionbar

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