<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>farp.blog &#187; auto layout</title>
	<atom:link href="http://fredandrandall.com/blog/tag/auto-layout/feed/" rel="self" type="application/rss+xml" />
	<link>http://fredandrandall.com/blog</link>
	<description>Bloggin&#039; about whatever</description>
	<lastBuildDate>Tue, 04 Nov 2014 07:15:30 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.0.38</generator>
	<item>
		<title>Getting started with Cocoa&#8217;s new auto layout</title>
		<link>http://fredandrandall.com/blog/2011/08/22/getting-started-with-cocoas-new-autolayout/</link>
		<comments>http://fredandrandall.com/blog/2011/08/22/getting-started-with-cocoas-new-autolayout/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 01:56:23 +0000</pubDate>
		<dc:creator><![CDATA[Randall]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[auto layout]]></category>
		<category><![CDATA[Cocoa]]></category>

		<guid isPermaLink="false">http://fredandrandall.com/blog/?p=514</guid>
		<description><![CDATA[Auto layout might be the most exciting Mac only thing announced at WWDC this year. It improves on Cocoa&#8217;s idea of springs and struts and will let spend way less time building your UI. Despite seeing auto layout used at &#8230; <a href="http://fredandrandall.com/blog/2011/08/22/getting-started-with-cocoas-new-autolayout/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Auto layout might be the most exciting Mac only thing announced at WWDC this year. It improves on Cocoa&#8217;s idea of springs and struts and will let spend way less time building your UI.</p>
<p>Despite seeing auto layout used at WWDC, I couldn&#8217;t remember how to use it a couple months later when I sat down to play with it. Apple&#8217;s <a href="http://developer.apple.com/library/mac/#documentation/UserExperience/Conceptual/AutolayoutPG/Articles/Introduction.html">programming guide</a> has lots of good stuff, but it seems to be missing a bit about getting started.</p>
<p>Default projects in Xcode 4.1 on 10.7 don&#8217;t default to using  auto layout so you&#8217;ll need to enable it. (Note: Projects using auto layout are 10.7 only)</p>
<p><a href="http://fredandrandall.com/blog/wp-content/uploads/2011/08/saveasautolayout.png"><img class="aligncenter size-full wp-image-515" title="saveasautolayout" src="http://fredandrandall.com/blog/wp-content/uploads/2011/08/saveasautolayout.png" alt="" width="256" height="348" /></a><span id="more-514"></span>So now you can use auto layout in your project. How do you use auto layout? By adding constraints. You&#8217;ll add constraints from the editor menu.</p>
<p><a href="http://fredandrandall.com/blog/wp-content/uploads/2011/08/wheretoaddconstraints.png"><img class="aligncenter size-full wp-image-516" title="wheretoaddconstraints" src="http://fredandrandall.com/blog/wp-content/uploads/2011/08/wheretoaddconstraints.png" alt="" width="561" height="335" /></a></p>
<p>You can also command+click on multiple controls and add constraints to more than one control at a time.</p>
<p>Here&#8217;s a short screencast of some simple things you can do with constraints. One great thing is that they work inside Xcode and you don&#8217;t need to build and run your app.</p>
<p><!-- copy and paste. Modify height and width if desired. --> <object id="scPlayer" width="746" height="490" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="quality" value="high" /><param name="flashVars" value="thumb=http://content.screencast.com/users/lladnar/folders/Jing/media/5b66bef8-002d-4277-bc2f-47bc60ff146a/FirstFrame.jpg&amp;containerwidth=746&amp;containerheight=490&amp;content=http://content.screencast.com/users/lladnar/folders/Jing/media/5b66bef8-002d-4277-bc2f-47bc60ff146a/00000129.mp4&amp;blurover=false" /><param name="allowFullScreen" value="true" /><param name="scale" value="showall" /><param name="allowScriptAccess" value="always" /><param name="base" value="http://content.screencast.com/users/lladnar/folders/Jing/media/5b66bef8-002d-4277-bc2f-47bc60ff146a/" /><param name="src" value="http://content.screencast.com/users/lladnar/folders/Jing/media/5b66bef8-002d-4277-bc2f-47bc60ff146a/jingh264player.swf" /><param name="flashvars" value="thumb=http://content.screencast.com/users/lladnar/folders/Jing/media/5b66bef8-002d-4277-bc2f-47bc60ff146a/FirstFrame.jpg&amp;containerwidth=746&amp;containerheight=490&amp;content=http://content.screencast.com/users/lladnar/folders/Jing/media/5b66bef8-002d-4277-bc2f-47bc60ff146a/00000129.mp4&amp;blurover=false" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><embed id="scPlayer" width="746" height="490" type="application/x-shockwave-flash" src="http://content.screencast.com/users/lladnar/folders/Jing/media/5b66bef8-002d-4277-bc2f-47bc60ff146a/jingh264player.swf" quality="high" flashVars="thumb=http://content.screencast.com/users/lladnar/folders/Jing/media/5b66bef8-002d-4277-bc2f-47bc60ff146a/FirstFrame.jpg&amp;containerwidth=746&amp;containerheight=490&amp;content=http://content.screencast.com/users/lladnar/folders/Jing/media/5b66bef8-002d-4277-bc2f-47bc60ff146a/00000129.mp4&amp;blurover=false" allowFullScreen="true" scale="showall" allowScriptAccess="always" base="http://content.screencast.com/users/lladnar/folders/Jing/media/5b66bef8-002d-4277-bc2f-47bc60ff146a/" flashvars="thumb=http://content.screencast.com/users/lladnar/folders/Jing/media/5b66bef8-002d-4277-bc2f-47bc60ff146a/FirstFrame.jpg&amp;containerwidth=746&amp;containerheight=490&amp;content=http://content.screencast.com/users/lladnar/folders/Jing/media/5b66bef8-002d-4277-bc2f-47bc60ff146a/00000129.mp4&amp;blurover=false" allowfullscreen="true" allowscriptaccess="always" /><iframe frameborder="0" scrolling="no" style="overflow:hidden;" src="http://www.screencast.com/users/lladnar/folders/Jing/media/5b66bef8-002d-4277-bc2f-47bc60ff146a/embed" height="490" width="746"></iframe></object></p>
]]></content:encoded>
			<wfw:commentRss>http://fredandrandall.com/blog/2011/08/22/getting-started-with-cocoas-new-autolayout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://content.screencast.com/users/lladnar/folders/Jing/media/5b66bef8-002d-4277-bc2f-47bc60ff146a/00000129.mp4&#038;amp" length="1408265" type="video/mp4" />
		</item>
	</channel>
</rss>
