title: Autoresizing subviews: resize seems to happen absolute instead of proportional
body: <p>I have a strange problem which probably has a very simple solution, I just can't see it ...</p>
  
  <p>I have an UIView class which contains a button as a subview, spanning the 4/5th of the width and one third of the view's height. When the parent view is resized (eg have the height and half the width), the button should stay where it is (top third of the parent view), and now also have half the width and still one third of the new height.</p>
  
  <p>That means:</p>
  
  <pre><code>Parent before: Frame (0,0,100,100)
  Button before: Frame (0,0,80,33.3)
  
  Parent after: Frame (0,0,50,50)
  Button after: Frame (0,0,40,16.7)
  </code></pre>
  
  <p>Problem is, button after always has the <strong>Frame (0,0,30,0)</strong>. It seems as if the new width and height of the button i just achieved by subtracting the 50 pixel change, instead of doing a proportional resize. Must be something really stupid, but I just can't find it.</p>
  
  <p>Here is the code of my UIView class:</p>
  
  <pre><code>-(id)init
  {
      self = [super init];
      if(self)
      {
          self.autoresizesSubviews = true;
  
          self.frame = CGRectMake(0,0,100,100);
          button = [UIButton buttonWithType:UIButtonTypeCustom];
          button.frame = CGRectMake(0,0,80, self.frame.size.height / 3);
          button.autoresizingMask = UIViewAutoresizingFlexibleHeight
                                    |UIViewAutoresizingFlexibleWidth;
  
          [self addSubview:button];
      }
  
      return self;
  }
  </code></pre>
  
  <p>Anyone an idea? I already tried quite some variations on the autoresizeMask flags, but no avail - and the above flags should also be the right ones ...</p>