Comments (3)
Glad to hear it's been helpful. As far as the issue you're seeing with iOS 8, here are the first two things I would check:
- Your rotation callbacks might not be happening on iOS 8 -- I would double check those are still working as expected first.
- When your rotation callback happens and you call
setNeedsUpdateConstraints
, isupdateConstraints
getting called on your cell and are your constraints being updated? Which view do you callsetNeedsUpdateConstraints
on?
Another recommendation I have is to consider moving away from observing the rotation notifications, and move towards making decisions using the new Adaptivity APIs in iOS 8 (assuming your deployment target is set to iOS 8 only). Instead of having the cells themselves try to handle rotations and remove constraints, I would have the table view controller implement the new viewWillTransitionToSize:withTransitionCoordinator:
method, and inside that method call reloadData
on your table view. I recently wrote up a related post on Stack Overflow which you might find helpful: http://stackoverflow.com/a/27409619/796419
Then in the resulting calls to tableView:cellForRowAtIndexPath:
from reloading the table, you can configure your cells for the new orientation -- I specifically recommend using a separate cell reuse identifier for your portrait vs landscape cell types to improve performance.
Good luck getting things working!
from tableviewcellwithautolayoutios8.
Thank you for your comments
As far as the two questions you pointed out I am sure that the callbacks are being sent and the setNeedsUpdateConstraints is called on the tableviewcell
Since I am targeting iOS 8 only I am going to look at your suggestion with the viewWillTransitionToSize:withTransitionCoordinator: methods, best regards
from tableviewcellwithautolayoutios8.
Hello mate I just realize what the problem was.
In iOS 7 the cell's contentView was automatically pinned to the cell and apparently in iOS 8 you have to add constraints so that the contentView has the same size and origins as the cell itself, otherwise it has some issues specially when the contentView grows or changes
Hope it helps you
from tableviewcellwithautolayoutios8.
Related Issues (20)
- "fatal error: use of unimplemented initializer" when running HOT 3
- Two multi-line labels HOT 5
- Adding a Dynamic UIView as a subview of the TableViewCell HOT 5
- Attempting to Display a UIImageView onto your Demo App
- Setting a cell's UITableViewCellAccessoryType creates an overly tall app HOT 3
- Adding new cell while scrolling causes table view to jump HOT 6
- swift: compiler error HOT 3
- Code does not compile HOT 1
- Some setup requirements? HOT 1
- Major Performance Issue with non-English UTF8 Strings
- I think we need know something
- Title label does not grow to size HOT 3
- Integrate support for expanding/collapsing cell
- Using UIWebView with MMMarkdown
- Constraints break when setting kLabelVerticalInsets to 16.0f
- Wrong margins with iOS 8.1 and 8.2
- iOS 10 UITableView with section unable to reload all data in section & rows and unable to set ContentOffset of UITableView
- Would you please specify the license?
- What if I replace bodyLabel with a button?
- Table is jumpy when scrolling bottom to top of table
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tableviewcellwithautolayoutios8.