<?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>Wed, 28 Jul 2010 23:26:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<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">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>
	<item>
		<title>By: miscousi</title>
		<link>http://blog.sallarp.com/iphone-uilabel-multiline-dynamic-height/comment-page-1/#comment-1307</link>
		<dc:creator>miscousi</dc:creator>
		<pubDate>Mon, 18 May 2009 08:23:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sallarp.com/?p=86#comment-1307</guid>
		<description>i&#039;ve added the code in an existing class of mine. How do i call the method if i want to use it in a tableView where i use a switch like this:

switch (indexPath.row) {
	    case 0: {
			cell.title = @&quot;test&quot;;
            cell.data = test;
        } break;
        case 1: {
			cell.title = @&quot;test&quot;;
            cell.data = test;
        } break;
        case 2: { 			
            cell.title = @&quot;test&quot;;
            cell.data = test;
        } break;


etc etc.</description>
		<content:encoded><![CDATA[<p>i&#8217;ve added the code in an existing class of mine. How do i call the method if i want to use it in a tableView where i use a switch like this:</p>
<p>switch (indexPath.row) {<br />
	    case 0: {<br />
			cell.title = @&#8221;test&#8221;;<br />
            cell.data = test;<br />
        } break;<br />
        case 1: {<br />
			cell.title = @&#8221;test&#8221;;<br />
            cell.data = test;<br />
        } break;<br />
        case 2: {<br />
            cell.title = @&#8221;test&#8221;;<br />
            cell.data = test;<br />
        } break;</p>
<p>etc etc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Smolinski</title>
		<link>http://blog.sallarp.com/iphone-uilabel-multiline-dynamic-height/comment-page-1/#comment-1108</link>
		<dc:creator>Smolinski</dc:creator>
		<pubDate>Wed, 13 May 2009 07:54:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sallarp.com/?p=86#comment-1108</guid>
		<description>It&#039;s ok, I understand that :)
Thank you anyway..</description>
		<content:encoded><![CDATA[<p>It&#8217;s ok, I understand that <img src='http://blog.sallarp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Thank you anyway..</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-1088</link>
		<dc:creator>Björn Sållarp</dc:creator>
		<pubDate>Tue, 12 May 2009 19:36:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sallarp.com/?p=86#comment-1088</guid>
		<description>The method is static, so you can add it to an existing/create a util-class and call it from anywhere. I don&#039;t really have time to create a demo for this anytime soon, sorry.</description>
		<content:encoded><![CDATA[<p>The method is static, so you can add it to an existing/create a util-class and call it from anywhere. I don&#8217;t really have time to create a demo for this anytime soon, sorry.</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)

Served from: blog.sallarp.com @ 2010-07-30 17:13:18 -->