• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: iOS: Automatically resizing subviews
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: iOS: Automatically resizing subviews


  • Subject: Re: iOS: Automatically resizing subviews
  • From: Development <email@hidden>
  • Date: Mon, 06 Jun 2011 09:35:13 -0700

That might be the problem. I'm not doing this in IB. I'm creating the view's programatically.

I also noticed that no matter what I do, the subview's auto resizing mask always returns 0;

Actually the whole thing is a screwed up mess.

Neither view seems to respond to the drawing code I try to use. For instance. I want the outer view to have a dashed border around it when it is selected.

I use
    CGContextRef context = UIGraphicsGetCurrentContext();

        CGContextSetLineWidth(context, 3.0);

        CGContextSetStrokeColorWithColor(context, [UIColor whiteColor].CGColor);

        CGFloat dashArray[] = {3,3};

        CGContextSetLineDash(context, 3, dashArray, 2);

        CGContextStrokePath(context);

and have no border at all.

Basically I don't know what I am doing wrong when I initialize these subclasses but it is all epic fail.

The only thing that actually works is filling the inner view's rectangle with a solid color and rotating it.


On Jun 6, 2011, at 8:38 AM, David Duncan wrote:

> On Jun 5, 2011, at 11:51 PM, Development wrote:
>
>> According to the docs if I want to automatically resize all the subviews of a view I need to set the View up with
>>
>>       [self setAutoresizesSubviews:YES];
>>       self.contentMode =UIViewContentModeScaleToFill;
>>
>> No?
>
>
> The contentMode is irrelevant (it has to do with how the view's graphical content – what you draw in -drawRect: – fits in the view, not its subviews).
>
> You may want to just spend a bit of time in Interface Builder prototyping this, as it can sometimes be difficult to predict what you get from setting the autoresizing masks in a particular way.
> --
> David Duncan
>

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: iOS: Automatically resizing subviews
      • From: Kyle Sluder <email@hidden>
References: 
 >iOS: Automatically resizing subviews (From: Development <email@hidden>)
 >Re: iOS: Automatically resizing subviews (From: David Duncan <email@hidden>)

  • Prev by Date: Re: NSTerminateLater and thread
  • Next by Date: Re: iOS: Automatically resizing subviews
  • Previous by thread: Re: iOS: Automatically resizing subviews
  • Next by thread: Re: iOS: Automatically resizing subviews
  • Index(es):
    • Date
    • Thread