Reputation: 51
I need to show a view(let us call it child view) as a popup on other view(let us call it parent view). The child view will contains images,labels and a button(TO dismiss the childView). I have googled for about an hour or so, but I am not really understanding on how to start the task. Kindly, help me with the approach,solution to resolve the issue.
Upvotes: 0
Views: 1540
Reputation: 304
Try this code.It will add a subview to your main view along with an animation:
//if you want to set your child view frame to your parent view frame.use this
self.childview.frame = self.view.frame;
//if not
self.childview.frame = CGRectMake(10,10,100,100);//ur own frame positon
self.childview.alpha = 0.0f;
[self.view addSubview:self.childview];
[UIView animateWithDuration:0.5 delay:0.0 options:UIViewAnimationCurveEaseOut
animations:^{
self.childview.alpha = 1.0f;
}
completion:^(BOOL finished) {
}];
///After this..if you want to remove it.
[self.childview removeFromSuperview];
Hope this will help you.
Upvotes: 2
Reputation: 20541
use this Demo for your this requirement..
In this Above demo you can access controls like UIButton ProgressBar,etc in your view from PopUPView This is Best Demo and SNPopupView
class to use with its delegate method
also this is another demo
Upvotes: 0