0

i am developing a app and it has this button call menu. When i click that button it addsubview the menu view to the main view. But I need to add it like comming out from the button. Like speech bubble.

enter image description here

Here is a sample image i take from some iphone app and they did awesome job to animate the view, like a bubble come out from button.

this is the app i am talking about which is having the animation i mentioning.

Download Waze App from here

if you are using iphone, download it and take a look at it. Then you will get proper idea about how that animation happening. Its a free app btw.

I search through the net to find a solution for this but i couldn't find any thing helpful. There are some ideas to do it like scalling the subview, using following code. I tried it with some view animations, it has some progress but not good enough.

CGAffineTransform transform = CGAffineTransformMakeScale(1.2, 1.2);

But I am pretty sure that is not the correct way to do it. There should be a proper way to do it.

Can any one give me help me to over come this issue.

Thanks in Advance

Sameera Chathuranga
  • 3,638
  • 3
  • 27
  • 48
  • Check this link if these helps you. http://www.raywenderlich.com/5478/uiview-animation-tutorial-practical-recipes – Darshan Jul 07 '12 at 06:38

2 Answers2

1

In my project I have used the following code for animating from left to right. Changing the value for CGAffineTransform (x and y position) will provide variations. Hope this would help you!

[self.view addSubview:subView];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.0];
CGAffineTransform t2 = CGAffineTransformMakeTranslation(SubView_Width, 0);
subView.transform = t2;
subView.alpha = 1;
[UIView commitAnimations];

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1];
[UIView setAnimationDelegate:self];
subView.alpha = 1;
subView.transform = CGAffineTransformIdentity;
[UIView commitAnimations];
Nina
  • 1,579
  • 2
  • 21
  • 51
  • Thanks for the reply .. But this is normal animation .. this is not what i want to do. If you are using iphone download this app and see how the menu appears .. that will give you the idea. http://itunes.apple.com/us/app/waze-social-gps-traffic/id323229106?mt=8 – Sameera Chathuranga Jul 06 '12 at 16:02
-1

you need this - popover for iPhone, http://mobiledevelopertips.com/open-source/ios-open-source-popover-api-for-iphone-wepopover.html

Saurabh Passolia
  • 8,099
  • 1
  • 26
  • 41