• 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: positioning two UILabels with auto layout problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: positioning two UILabels with auto layout problem


  • Subject: Re: positioning two UILabels with auto layout problem
  • From: Robert Vojta <email@hidden>
  • Date: Thu, 20 Jun 2013 09:00:12 +0200

Hi,

or you can use visual format, which is much shorter …

  NSDictionary *viewsDictionary = NSDictionaryOfVariableBindings( _firstLabel, _secondLabel );
  [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:[_firstLabel(>=16)]-16-[_secondLabel(>=16)]"
                                                               options:0
                                                               metrics:nil
                                                                 views:viewsDictionary]];

… or look at some of my macros …

https://github.com/robertvojta/mDevCamp-2013/blob/master/Auto Layout Demo/TMAutoLayout.h

… and your code can be much shorter …

  TMALVariableBindingsAMNO( _firstLabel, _secondLabel );
  TMAL_ADD_VISUAL( self.view, @"V:[_firstLabel(>=16)]-16-[_secondLabel(>=16)]" );


R.

_______________________________________________

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


References: 
 >positioning two UILabels with auto layout problem (From: Koen van der Drift <email@hidden>)
 >Re: positioning two UILabels with auto layout problem (From: Koen van der Drift <email@hidden>)

  • Prev by Date: Re: Something is constantly updating my scroll view's contentSize
  • Next by Date: Detect a Retina display
  • Previous by thread: Re: positioning two UILabels with auto layout problem
  • Next by thread: Something is constantly updating my scroll view's contentSize
  • Index(es):
    • Date
    • Thread