So I had a UITableView inside a View Controller (not a UITableViewController) and to support iphone 6 & 6 Plus I started to implement Autolayout. Everything working nice and smooth right now, the problem is that I had resize animations on UIViews inside each cell of that UITableView and now animations don't resize the inner views, the constraints seem to affect everything inside the UITableView even though I only wanted to keep the UITableView centered through different devices...
The constraints I'm using on the UITableView are:
- Center X Alignment on content view
- Vertical Space (To the top of the content view, with a fixed value = 114)
- Vertical Space (To the bottom of the content view, with a fixed value = 0)
- Fixed Width on the UITableView (320)
So basically, if we're on iphones 4-5s we have a tableview using the complete width of the screen, meanwhile iphones 6 & 6 Plus have a centered tableview of 320 fixed width.
This is the first time I've used AutoLayout, so I don't know how these constraints are affecting the animations on views inside cells of the UITableView, this is how I made the call:
//before the call
barraActual.frame = CGRectMake(20, 24, 5, 30);
barraPromedio.frame = CGRectMake(295, 24, 5, 30);
//animate
[UIView animateWithDuration:1.5 animations:^{
barraActual.frame = CGRectMake(20, 24, periodoActual, 30);
barraPromedio.frame = CGRectMake(20+periodoActual, 24, periodoAnterior, 30);
}];
EDIT: Please note that the views (barraActual & barraPromedio) are UIViews within UITableViewCell, and this code is inside the "cellForRowAtIndexPath".
How do I stop the constraints from blocking the resize on my views? (because I've tried setting the frame without the animation call and didn't work either)
Or how to I make a animation call that works along these constraints?
Thanks!