I am little bit new at AutoLayout.I know already tons of question and tutorial available regarding this autoLayout but I have not found my solution.So Thanks in advance for any help.
What is my requirement?
I have to make UIView which will come to screen after pressing a button from the bottom side of the screen with animation.(Like Keyboard).I have made this UIView in a xib file using autoLayout.So far i have done like this.
In ViewDidLoad:
//Loading custom UIView
containerView = [[SharingPickerView alloc] init];
[containerView loadingMenus:pickerData];
[self.view addSubview:containerView];
In this view it contatains (a scrollview then a page controller then a cancel button)
In ViewWillLayoutSubviews:
-(void)viewWillLayoutSubviews{
[super viewWillLayoutSubviews];
//Changing the frame of view to bottom side of the screen so that we can animate it later from bottom to top later.
containerView.frame = CGRectMake(0, self.view.frame.size.height, self.view.frame.size.width, containerView.frame.size.height);
[containerView setBackgroundColor:[[UIColor colorWithRed:231.0/255.0f green:231.0/255.0f blue:231.0/255.0f alpha:1.0f] colorWithAlphaComponent:0.3]];
}
Now on press for animation.
-(void)sharePickerView{
[UIView animateWithDuration:1 animations:^(){
containerView.frame = CGRectMake(0,self.view.frame.size.height-containerView.frame.size.height, self.view.frame.size.width, containerView.frame.size.width);
} completion:^(BOOL isFinished){
NSLog(@"Animation Finish");
}];
}
Here i am re-framing the View for showing that animation but some bottom portion(cancel button of that view) is not showing in iPhone 6 simulator but it is showing perfectly iPhone 5s device.
Regards Emon.