Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

ViewPager hosted in Fragment

$
0
0

Hi,

I have an Android.Support.V4.View.ViewPager hosted in a parent Fragment. In the Fragments OnViewCreated() method, I am attempting to assign the ViewPager to a local variable using : " Android.Support.V4.View.ViewPager mPager = (ViewPager)view.FindViewById(Resource.Id.viewpagerdetail);
" but at runtime I get a "System.InvalidCastException". I can reference TextView's in the same Layout, just not the ViewPager.

I am probably doing something stupid, but cant find it. Any ideas ? Code is attached.

Kind Regards,

Ian


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>