infinitered / redpotion

We believe iPhone development should be clean, scalable, and fast with a language that developers not only enjoy, but actively choose. With the advent of Ruby for iPhone development the RubyMotion community has combined and tested the most active and powerful gems into a single package called RedPotion
MIT License
234 stars 40 forks source link

Frame isn't properly calculated #147

Closed buffpojken closed 9 years ago

buffpojken commented 9 years ago

When appending views inside other views:

class SignupStartView < UIView
    attr_reader :sign_up, :sign_in
    def initWithFrame(rect)
        if super
            append!(UIImageView, :logo)
        end
        self
    end
    def drawRect(rect)
        super
    end
end

and then setting the frame of UIImageView with:

  def logo(st)
    st.image = UIImage.imageNamed('signup/logo_title.png')
        st.frame = {l: 5, t: 5, fr: 5, fb: 5}
  end

frame isn't properly calculated. Even though the SignupStartView receives a frame of

<CGRect origin=#<CGPoint x=0.0 y=0.0> size=#<CGSize width=375.0 height=274.0>>

the frame of the UIImageView is set to:

<CGRect origin=#<CGPoint x=-5.0 y=-5.0> size=#<CGSize width=10.0 height=10.0>>

When setting widht/height manually in the stylesheet, it works as expected?

buffpojken commented 9 years ago

Never mind this, of course order of style-applying matters.