Search code examples
xamarin.androidmvvmcross

Does MVVMCross support ActionBar?


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?


Solution

  • 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