Giter VIP home page Giter VIP logo

Comments (3)

smileyborg avatar smileyborg commented on May 22, 2024

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:

  1. Your rotation callbacks might not be happening on iOS 8 -- I would double check those are still working as expected first.
  2. When your rotation callback happens and you call setNeedsUpdateConstraints, is updateConstraints getting called on your cell and are your constraints being updated? Which view do you call setNeedsUpdateConstraints 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.

smoscar avatar smoscar commented on May 22, 2024

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.

smoscar avatar smoscar commented on May 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.