javascript - CATransition displays animation out of the desired view -


i using catranstion animation move between multiple html pages in uiwebview.

[webview loadhtmlstring:htmlpage baseurl:nil];             catransition *animation = [catransition animation];             [animation settype:kcatransitionpush];             [animation setsubtype:kcatransitionfromleft];             [animation settimingfunction:[camediatimingfunction functionwithname:kcamediatimingfunctiondefault]];             [animation setspeed:0.3];             [[webview layer] addanimation:animation forkey:nil];             [uiview commitanimations]; 

the web view not displayed in totality of ios device screen, displayed in middle of it. problem when transition performed, text displayed out of web view, want animation doesn't go out of web view. please help.

this way how catransition works.

i recommend add uiwebview subview of container view , set clipstobounds = yes container view. should work want.

try this:

uiview *containerview = [[uiview alloc] initwithframe:cgrectmake(60, 60, 200, 200)]; containerview.clipstobounds = yes; [self.view addsubview:containerview];  _webview = [[uiwebview alloc] initwithframe:containerview.bounds]; _webview.backgroundcolor = [uicolor redcolor]; [containerview addsubview:_webview]; 

your transition code ok , should want

simplified explanation of happening: transition makes "bitmap screenshot" of layer before , after animation. makes animation. in case, gets 2 bitmaps, puts new 1 on left of old 1 , "pushes" old off right.


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -