View Animations

Is it possible to use animations using NativeUIView?



something like?



vExisting.View.setFrame(CGRectMake(0, 480, 320, 480));

vExisting.Visible := True;

vExisting.BringToFront;

vExisting.View.beginAnimations(nil, nil);

vExisting.View.setAnimationDuration(0.4);

vExisting.View.setFrame(CGRectMake(0,0,320,480));

vExisting.View.commitAnimations;



(I have exposed these properties to the view class)

Hi, 


The block animations are actually class methods and can be access by calling the OCClass implementation like the code below

Add the unit iOSApi.UIKit in the uses list of your application.

then add this code in a button click with a default TMSFMXNativeUIView on the form and it should
animate from the bottom up.

  TMSFMXNativeUIView1.SetBounds(0, 480, 320, 480);
  TMSFMXNativeUIView1.Visible := True;
  TMSFMXNativeUIView1.BringToFront;
  TUIView.OCClass.beginAnimations(nil, nil);
  TUIView.OCClass.setAnimationDuration(0.4);
  TMSFMXNativeUIView1.SetBounds(0, 0, 320, 480);
  TUIView.OCClass.commitAnimations;

You can set the frame directly on the view, but you can also set the bounds of the control wrapper like in the sample, to avoid that the control automatically repositions the native view.

Kind Regards, 
Pieter

Pieter Scheldeman2013-07-01 16:20:14