Xamarin iOS image change transition -
i developing app xamarin.ios , not using xamarin.forms.
have screen have set image view.
change between 2/3/4 images transition (fade, move in ... not matter).
there way can that?
here code until now:
imgview.animationimages = new uiimage[] { uiimage.frombundle ("tmp_running.jpg") , uiimage.frombundle ("tmp_cycling.jpg") } ; imgview.animationrepeatcount = 0; imgview.animationduration = 3; imgview.startanimating ();
i have tried approach:
catransition customtransition = new catransition(); customtransition.fadeinduration = 3.0f; customtransition.fadeoutduration = 3.0f; customtransition.timingfunction = camediatimingfunction.fromname( camediatimingfunction.easeineaseout); customtransition.type = catransition.transitionfade; , : imgview.layer.addanimation(customtransition, null);
but nothing worked.
do know how simple task?
could this:
static int count = 0; uiimageview _imageview; public override void viewdidload () { base.viewdidload (); _imageview = new uiimageview (new cgrect(0, 0, 100, 100)); _imageview.image = new uiimage ("1.png"); add (_imageview); animateimage (); } public void animateimage() { var animationimages = new list<uiimage> () { uiimage.fromfile ("1.png"), uiimage.fromfile ("2.png"), uiimage.fromfile ("3.png"), uiimage.fromfile ("4.png"), uiimage.fromfile ("5.png")}; uiimage image = animationimages[count % animationimages.count]; uiview.transition (_imageview, 3.0, uiviewanimationoptions.transitioncrossdissolve, () => {_imageview.image = image;}, () => { animateimage (); count++; } ); }
Comments
Post a Comment