简体   繁体   中英

Xamarin Android conflicting with MvvmCross

Im trying to create a Fragment and add it to a Activity using the FragmentManager .

The problem is i get a compile error. It appears that MvxFragment inherits from Android.Support.V4.App.Fragment and MvxFragmentActivity inherits from Android.Support.V4.App.FragmentActivity that in turns inherits from Android.App.FragmentActivity

This means the FragmentManager expects a Android.App.Fragment but MvvmCross uses Android.Support.V4.App.Fragment

How do i get around this?

MvvmCross has support for both Fragment and V4.Fragment . To use the first you should only install the MvvmCross.Droid.FullFragging . When using V4 you should install the MvvmCross.Droid.Support.V7.Fragging and 'MvvmCross.Droid.V7.AppCompat'.

As base for your activity you could use MvxAppCompatActivity or the MvxCachingFragmentActivity .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM