Khalsa Labs

BB10 Cascades Animation Easy Tutorial

Hi, here we got the BB10 Cascades Animation Easy Tutorial , for learn the animation usings cascades UI in easy way. The small lines of code make it easy to feel like developer..

As the blackberry 10 cascade development are very easy to learn, blackberry itsekf provides many tutorials for that ,we are also trying to make ease for begginers at BB10 development. Here the code for animate an image.

 

 


import bb.cascades 1.0
Page {
 id: detail
Container {

Label : {
text: qsTr("click on image")
}
 ImageView {
 id: imageview
 imageSource: "asset:///images/singhs.jpg"
 preferredHeight: 300
 onTouch: {
 if(event.isDown())
     {
       animTest.play()
     }
 }
         }

 animations: [
 TranslateTransition {
 id: animTest
 fromX: 20
 fromY: 10
 toX: HorizontalAlignment.Center
 toY: 300
 } ]

}
}

 

In above code,Translate animation is used.. you can use other animations same like this. The other animation supported are:

  • FadeTransition
  • RotateTransition
  • ScaleTransition
  • TranslateTransition

The following two tabs change content below.
Python Developer and DIY lover.

want to comment ??

Your email address will not be published. Required fields are marked *