iOS Question How to build a B4i App like iOS8 Safari 3D-View?

Ju Yang

Active Member
Licensed User
Longtime User
I am a B4i Beginner, Our company have a small project,
Need to develop a B4i App like iOS8 Safari 3D-View (and the animation effect must like Safari 3D View).

I knew Xamarin.iOS Code, it need use CoreAnimation Namespace's classes,
and Use UIView class to implement,
But in B4i, even I don't know what is the 'UIView' in B4i.

I need some idea, and I want to get more B4i tutorial documents.

See the pictures.
 

Attachments

  • 2@G`BNF1U1RVITG4(U@2SEY.png
    2@G`BNF1U1RVITG4([email protected]
    136.9 KB · Views: 285
  • 76{JKF7F~~HFPK$H`UJ{P7I.png
    76{JKF7F~~HFPK$H`UJ{P7I.png
    107.8 KB · Views: 299

Ju Yang

Active Member
Licensed User
Longtime User
B4i View is the same as native iOS UIView. You will need to use the inline objective c code feature to create such an animation.

The B4i API only includes 2d animations for now.

It means I can't use Basic code to make the 3D View now?
 
Upvote 0

JanPRO

Well-Known Member
Licensed User
Longtime User
Right, but you can use inline objective c code like Erel already said.

For example (a simple rotation):

B4X:
  Dim NaObj As NativeObject = Me
  NaObj.RunMethod("Animation:",Array(Panel1))


#If OBJC
- (void)Animation: (UIView *)someView {

CATransform3D rotationAndPerspectiveTransform = CATransform3DIdentity;
rotationAndPerspectiveTransform.m34 = 1.0 / -1000.0;
rotationAndPerspectiveTransform = CATransform3DRotate(rotationAndPerspectiveTransform, M_PI * 0.6, 1.0f, 0.0f, 0.0f);
[UIView animateWithDuration:1.0 animations:^{
  someView.layer.anchorPoint = CGPointMake(0.5, 0);
  someView.layer.transform = rotationAndPerspectiveTransform;
} completion:^(BOOL finished){
  // code to be executed when flip is completed
}];

}
#End If

based on: http://stackoverflow.com/questions/15374215/simple-core-animations-3d-transform-of-uiview


Use Core Animations for 3D animations.
 
Upvote 0
Top