<?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: Is UIButton&#8217;s backgroundImage broken?</title>
	<atom:link href="http://www.24100.net/2009/02/is-uibuttons-backgroundimage-broken/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.24100.net/2009/02/is-uibuttons-backgroundimage-broken/</link>
	<description>Ralf Rottmann – CTO at GrandCentrix, Blogger for The Next Web, iOS and Android Developer, Social Media Addict</description>
	<lastBuildDate>Sat, 10 Dec 2011 16:21:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: chris</title>
		<link>http://www.24100.net/2009/02/is-uibuttons-backgroundimage-broken/comment-page-1/#comment-191</link>
		<dc:creator>chris</dc:creator>
		<pubDate>Mon, 06 Apr 2009 15:10:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.24100.net/?p=288#comment-191</guid>
		<description>hey.. Im having a nightmare with Images in buttons myself, UI Classes should be the easy stuff to deal with in a project!

I wonder if you would explain how you are using a TTF in your app? I didn&#039;t think this was possible...</description>
		<content:encoded><![CDATA[<p>hey.. Im having a nightmare with Images in buttons myself, UI Classes should be the easy stuff to deal with in a project!</p>
<p>I wonder if you would explain how you are using a TTF in your app? I didn&#8217;t think this was possible&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jean-Sebastien</title>
		<link>http://www.24100.net/2009/02/is-uibuttons-backgroundimage-broken/comment-page-1/#comment-185</link>
		<dc:creator>Jean-Sebastien</dc:creator>
		<pubDate>Thu, 02 Apr 2009 17:41:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.24100.net/?p=288#comment-185</guid>
		<description>Oh, I forgot the (dirty dirty hack like) solution

Just add &quot;[self bringSubviewToFront:myView];&quot; in a subclass of the button&#039;s &quot;layoutSubviews&quot;. This require a hard reference to myView, but thats easier than laying out subviews by hand from the controller.</description>
		<content:encoded><![CDATA[<p>Oh, I forgot the (dirty dirty hack like) solution</p>
<p>Just add &#8220;[self bringSubviewToFront:myView];&#8221; in a subclass of the button&#8217;s &#8220;layoutSubviews&#8221;. This require a hard reference to myView, but thats easier than laying out subviews by hand from the controller.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jean-Sebastien</title>
		<link>http://www.24100.net/2009/02/is-uibuttons-backgroundimage-broken/comment-page-1/#comment-184</link>
		<dc:creator>Jean-Sebastien</dc:creator>
		<pubDate>Thu, 02 Apr 2009 17:24:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.24100.net/?p=288#comment-184</guid>
		<description>@ Corey : This is broken. A &quot;background&quot; view should be in the background. If this is expected behavior, Apple is more moronic than I expected.

Overlaying views ABOVE the button is all fine and dandy, until you realize that you need to manually calculate their positions when layourSubviews gets called after a screen rotation. Add to that the fact that you need to fake the button&#039;s state, and you are reinventing the wheel.

Saying that this is expected behavior doesn&#039;t make any sense.</description>
		<content:encoded><![CDATA[<p>@ Corey : This is broken. A &#8220;background&#8221; view should be in the background. If this is expected behavior, Apple is more moronic than I expected.</p>
<p>Overlaying views ABOVE the button is all fine and dandy, until you realize that you need to manually calculate their positions when layourSubviews gets called after a screen rotation. Add to that the fact that you need to fake the button&#8217;s state, and you are reinventing the wheel.</p>
<p>Saying that this is expected behavior doesn&#8217;t make any sense.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Corey</title>
		<link>http://www.24100.net/2009/02/is-uibuttons-backgroundimage-broken/comment-page-1/#comment-10</link>
		<dc:creator>Corey</dc:creator>
		<pubDate>Tue, 17 Feb 2009 20:42:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.24100.net/?p=288#comment-10</guid>
		<description>I ran in to this problem...
I went to the Tech Talk in Toronto, and asked an engineer about my button problems (forgot his name).  He basically told me that was expected behavior, and I should go about it another way.  He kind of just glazed over it, but that made me rethink my interface.

My suggestions are (none of which you will be happy about):  
1. If you only have a few buttons on the screen, don&#039;t make your custom labels a subview of the button, make them a subview of the buttons superview.

2.  If you have a lot of buttons (I have over a hundred, a periodic table in case that seems crazy) and are worried about killing the processor with doubling the amount of views on screen, don&#039;t use UIButton, use UIView or UIImageView.  You can &quot;fake&quot; button like behavior by overriding the toucheBegan, touchesEnded, touchesMoved methods.  A little bit of a chore but gives you the flexibility you want. 

Good luck.</description>
		<content:encoded><![CDATA[<p>I ran in to this problem&#8230;<br />
I went to the Tech Talk in Toronto, and asked an engineer about my button problems (forgot his name).  He basically told me that was expected behavior, and I should go about it another way.  He kind of just glazed over it, but that made me rethink my interface.</p>
<p>My suggestions are (none of which you will be happy about):<br />
1. If you only have a few buttons on the screen, don&#8217;t make your custom labels a subview of the button, make them a subview of the buttons superview.</p>
<p>2.  If you have a lot of buttons (I have over a hundred, a periodic table in case that seems crazy) and are worried about killing the processor with doubling the amount of views on screen, don&#8217;t use UIButton, use UIView or UIImageView.  You can &#8220;fake&#8221; button like behavior by overriding the toucheBegan, touchesEnded, touchesMoved methods.  A little bit of a chore but gives you the flexibility you want. </p>
<p>Good luck.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sal</title>
		<link>http://www.24100.net/2009/02/is-uibuttons-backgroundimage-broken/comment-page-1/#comment-9</link>
		<dc:creator>Sal</dc:creator>
		<pubDate>Tue, 17 Feb 2009 17:13:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.24100.net/?p=288#comment-9</guid>
		<description>I found the same thing when setting the background for a tablecontrollers navbar.

Essentially, whenever I added a subview to the navigationBar, the &#039;Back&#039; button wouldn&#039;t respond to touches.

I wound up adding a UIImageView to the navigationBar instead of just a UIView. That solved the problem of the image being the top layer.</description>
		<content:encoded><![CDATA[<p>I found the same thing when setting the background for a tablecontrollers navbar.</p>
<p>Essentially, whenever I added a subview to the navigationBar, the &#8216;Back&#8217; button wouldn&#8217;t respond to touches.</p>
<p>I wound up adding a UIImageView to the navigationBar instead of just a UIView. That solved the problem of the image being the top layer.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CJ Millisock</title>
		<link>http://www.24100.net/2009/02/is-uibuttons-backgroundimage-broken/comment-page-1/#comment-8</link>
		<dc:creator>CJ Millisock</dc:creator>
		<pubDate>Mon, 16 Feb 2009 22:20:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.24100.net/?p=288#comment-8</guid>
		<description>Yes, that is broken.  I&#039;d say file a bug report.</description>
		<content:encoded><![CDATA[<p>Yes, that is broken.  I&#8217;d say file a bug report.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)
Database Caching using disk: basic
Object Caching 476/480 objects using disk: basic

Served from: www.24100.net @ 2012-02-07 21:20:27 -->
