<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: iPhone dev &#8211; UILabel multiline and dynamic height</title>
	<atom:link href="http://blog.sallarp.com/iphone-uilabel-multiline-dynamic-height/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sallarp.com/iphone-uilabel-multiline-dynamic-height/</link>
	<description>Code, Code, Revolution!</description>
	<lastBuildDate>Sat, 17 Dec 2011 11:50:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
	<item>
		<title>By: ThE uSeFuL</title>
		<link>http://blog.sallarp.com/iphone-uilabel-multiline-dynamic-height/comment-page-1/#comment-26685</link>
		<dc:creator>ThE uSeFuL</dc:creator>
		<pubDate>Fri, 22 Apr 2011 18:41:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sallarp.com/?p=86#comment-26685</guid>
		<description>Hey,
Do you know how we could change the line height (not the frame height, like you have done here) of a UILabel?  I&#039;m looking at a UILabel with multiple lines.</description>
		<content:encoded><![CDATA[<p>Hey,<br />
Do you know how we could change the line height (not the frame height, like you have done here) of a UILabel?  I&#8217;m looking at a UILabel with multiple lines.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eddy</title>
		<link>http://blog.sallarp.com/iphone-uilabel-multiline-dynamic-height/comment-page-1/#comment-16102</link>
		<dc:creator>eddy</dc:creator>
		<pubDate>Sat, 04 Dec 2010 04:00:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sallarp.com/?p=86#comment-16102</guid>
		<description>this is awesome!!! thanks</description>
		<content:encoded><![CDATA[<p>this is awesome!!! thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Neddy</title>
		<link>http://blog.sallarp.com/iphone-uilabel-multiline-dynamic-height/comment-page-1/#comment-13995</link>
		<dc:creator>Neddy</dc:creator>
		<pubDate>Tue, 05 Oct 2010 09:51:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sallarp.com/?p=86#comment-13995</guid>
		<description>you rock :)</description>
		<content:encoded><![CDATA[<p>you rock <img src='http://blog.sallarp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: iPhoneDev</title>
		<link>http://blog.sallarp.com/iphone-uilabel-multiline-dynamic-height/comment-page-1/#comment-6744</link>
		<dc:creator>iPhoneDev</dc:creator>
		<pubDate>Fri, 01 Jan 2010 09:27:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sallarp.com/?p=86#comment-6744</guid>
		<description>Hi Smolinski, Rob Mathews

I worked for for “heightForRowAtIndexPath” of tableview.
You can take idea from here

http://urenjoy.blogspot.com/2009/07/dynamic-multiline-label-custom-font.html</description>
		<content:encoded><![CDATA[<p>Hi Smolinski, Rob Mathews</p>
<p>I worked for for “heightForRowAtIndexPath” of tableview.<br />
You can take idea from here</p>
<p><a href="http://urenjoy.blogspot.com/2009/07/dynamic-multiline-label-custom-font.html" rel="nofollow">http://urenjoy.blogspot.com/2009/07/dynamic-multiline-label-custom-font.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Mathews</title>
		<link>http://blog.sallarp.com/iphone-uilabel-multiline-dynamic-height/comment-page-1/#comment-6574</link>
		<dc:creator>Rob Mathews</dc:creator>
		<pubDate>Thu, 24 Dec 2009 01:58:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sallarp.com/?p=86#comment-6574</guid>
		<description>Has someone worked through enabling functionality for “heightForRowAtIndexPath” using the current source code. If yes, please post the changes/updates that need to be made.</description>
		<content:encoded><![CDATA[<p>Has someone worked through enabling functionality for “heightForRowAtIndexPath” using the current source code. If yes, please post the changes/updates that need to be made.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shilpa</title>
		<link>http://blog.sallarp.com/iphone-uilabel-multiline-dynamic-height/comment-page-1/#comment-4381</link>
		<dc:creator>Shilpa</dc:creator>
		<pubDate>Wed, 07 Oct 2009 12:20:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sallarp.com/?p=86#comment-4381</guid>
		<description>Hi! Above tip for multiline label height calculation helped me a lot. Thank you.</description>
		<content:encoded><![CDATA[<p>Hi! Above tip for multiline label height calculation helped me a lot. Thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: miscousi</title>
		<link>http://blog.sallarp.com/iphone-uilabel-multiline-dynamic-height/comment-page-1/#comment-1638</link>
		<dc:creator>miscousi</dc:creator>
		<pubDate>Wed, 27 May 2009 07:42:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sallarp.com/?p=86#comment-1638</guid>
		<description>You don&#039;t have to answer or show this or my latest reply. I&#039;ve solved it myself, thanks for help!</description>
		<content:encoded><![CDATA[<p>You don&#8217;t have to answer or show this or my latest reply. I&#8217;ve solved it myself, thanks for help!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: miscousi</title>
		<link>http://blog.sallarp.com/iphone-uilabel-multiline-dynamic-height/comment-page-1/#comment-1578</link>
		<dc:creator>miscousi</dc:creator>
		<pubDate>Mon, 25 May 2009 10:51:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sallarp.com/?p=86#comment-1578</guid>
		<description>My second week with this, sry.

But i guess that &quot;value&quot; is your label that you use later in your tableView?

But when i&#039;m going to use my label in my switch as I describe earlier like this:

switch (indexPath.row) {
case 0: {
cell.value.text = myData;
} break;

I get the message: request for meber &quot;value&quot; in something not a structure or a union.?</description>
		<content:encoded><![CDATA[<p>My second week with this, sry.</p>
<p>But i guess that &#8220;value&#8221; is your label that you use later in your tableView?</p>
<p>But when i&#8217;m going to use my label in my switch as I describe earlier like this:</p>
<p>switch (indexPath.row) {<br />
case 0: {<br />
cell.value.text = myData;<br />
} break;</p>
<p>I get the message: request for meber &#8220;value&#8221; in something not a structure or a union.?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Björn Sållarp</title>
		<link>http://blog.sallarp.com/iphone-uilabel-multiline-dynamic-height/comment-page-1/#comment-1356</link>
		<dc:creator>Björn Sållarp</dc:creator>
		<pubDate>Tue, 19 May 2009 20:16:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sallarp.com/?p=86#comment-1356</guid>
		<description>I have added the method to a utils class but you can add it to your table view class or whatever. This is how I call the method in my TableCell class:

- (void)setValueAndCalculateHeight:(NSString *)text
{
	self.value.text = text;
	
	CGRect frame = value.frame;
	frame.size.height = [MLUtils calculateHeightOfTextFromWidth:self.value.text :self.value.font :frame.size.width :self.value.lineBreakMode];
	
	//If the new height is larger then min height we add the frame to description label
	if(frame.size.height&gt;VALUE_MIN_HEIGHT)
	{
		self.value.frame = frame;		
	}
}

So to set the text in the cell i pass it to my function which will call the static calculateHeightOfTextFromWidth method in my MLUtils class. The height is used to adjust the frame of the cell. Hope this helps. Good luck!</description>
		<content:encoded><![CDATA[<p>I have added the method to a utils class but you can add it to your table view class or whatever. This is how I call the method in my TableCell class:</p>
<p>- (void)setValueAndCalculateHeight:(NSString *)text<br />
{<br />
	self.value.text = text;</p>
<p>	CGRect frame = value.frame;<br />
	frame.size.height = [MLUtils calculateHeightOfTextFromWidth:self.value.text :self.value.font :frame.size.width :self.value.lineBreakMode];</p>
<p>	//If the new height is larger then min height we add the frame to description label<br />
	if(frame.size.height>VALUE_MIN_HEIGHT)<br />
	{<br />
		self.value.frame = frame;<br />
	}<br />
}</p>
<p>So to set the text in the cell i pass it to my function which will call the static calculateHeightOfTextFromWidth method in my MLUtils class. The height is used to adjust the frame of the cell. Hope this helps. Good luck!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: miscousi</title>
		<link>http://blog.sallarp.com/iphone-uilabel-multiline-dynamic-height/comment-page-1/#comment-1349</link>
		<dc:creator>miscousi</dc:creator>
		<pubDate>Tue, 19 May 2009 15:01:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sallarp.com/?p=86#comment-1349</guid>
		<description>Hm.. am i doing totally wrong or is it a way to call this method like I describe it ?:]</description>
		<content:encoded><![CDATA[<p>Hm.. am i doing totally wrong or is it a way to call this method like I describe it ?:]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)
Database Caching 1/16 queries in 0.033 seconds using disk
Object Caching 388/393 objects using disk

Served from: blog.sallarp.com @ 2012-02-05 04:06:54 -->
