colinta / teacup

This project has been sunset in favor of MotionKit
github.com/motion-kit/motion-kit
Other
602 stars 85 forks source link

Orientation styles doesn't work #116

Closed holgersindbaek closed 11 years ago

holgersindbaek commented 11 years ago

I can't get orientation styles to work when the iphone re-orientates. They work well enough when initializing the view, but not when the view re-orientates.

style :label,
    landscape: {
      hidden: true
    },
    portrait: {
      hidden: false
    }

I'm handling orientation manually btw.

Any ideas of why this might happen?

colinta commented 11 years ago

The specs have tests for orientation changes, so it's definitely strange that such a simple use case would fail.

Are you running iOS 7? I cannot support iOS 7 in teacup until the NDA is removed.

holgersindbaek commented 11 years ago

No… Normal iOS 6.

Do you think it has something to do with me handling the orientation manually?

All the best

Holger Sindbaek Holgersindbaek.com (http://Holgersindbaek.com)

Co-founder Uninkd.com (http://Uninkd.com) Meer.li (http://Meer.li)

On Thursday, August 22, 2013 at 9:36 PM, Colin T.A. Gray wrote:

The specs have tests for orientation changes, so it's definitely strange that such a simple use case would fail. Are you running iOS 7? I cannot support iOS 7 in teacup until the NDA is removed.

— Reply to this email directly or view it on GitHub (https://github.com/rubymotion/teacup/issues/116#issuecomment-23118728).

colinta commented 11 years ago

Possibly; I've never heard of such a thing, actually. What do you mean by that?

colinta commented 11 years ago

Are you implementing willAnimateRotationToInterfaceOrientation(duration:)?

This is the teacup method:

def willAnimateRotationToInterfaceOrientation(orientation, duration:duration)
  view.restyle!(orientation)
end

You can call super, or call restyle! like it is here.