<?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>Notes of a Developer &#187; UITabBar</title>
	<atom:link href="http://www.developers-life.com/tag/uitabbar/feed" rel="self" type="application/rss+xml" />
	<link>http://www.developers-life.com</link>
	<description>Develop on Objective-C, UIKit, C, OpenGL for  iPhone, iPad, Mac OS X</description>
	<lastBuildDate>Fri, 03 Feb 2012 11:49:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Make gradient on iPhone/iPad</title>
		<link>http://www.developers-life.com/make-gradient-on-iphoneipad.html</link>
		<comments>http://www.developers-life.com/make-gradient-on-iphoneipad.html#comments</comments>
		<pubDate>Sun, 30 May 2010 18:57:09 +0000</pubDate>
		<dc:creator>Vladimir Boychentsov</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Gradient]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[UIKit]]></category>
		<category><![CDATA[UITabBar]]></category>

		<guid isPermaLink="false">http://www.developers-life.com/?p=983</guid>
		<description><![CDATA[It&#8217;s easy! As of iPhone SDK 3.0, custom gradients can be implemented very easily, without subclassing or images, by using the new CAGradientLayer add framework 1#import &#60; QuartzCore/QuartzCore.h&#62; so, example: or 123456789101112UIView *myTabView = &#91;&#91;UIView alloc&#93; initWithFrame:frame&#93;; &#160; &#160; &#160;CAGradientLayer *gradient = &#91;CAGradientLayer layer&#93;; &#160; &#160; &#160;gradient.frame = myTabView.bounds; &#160; &#160; &#160;gradient.colors = &#91;NSArray arrayWithObjects: [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s easy! As of iPhone SDK 3.0, custom gradients can be implemented very easily,  without subclassing or images, by using the new CAGradientLayer</p>
<p>add framework</p>
<div class="codecolorer-container objc geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:810px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6e371a;">#import &lt; QuartzCore/QuartzCore.h&gt;</span></div></td></tr></tbody></table></div>
<p>so, example:</p>
<p><a href="http://gyazo.com/7c6b82b7e31568c52a4b267e4f91c78b.png" target="_blank"><img class="alignnone" title="make custom gradient on iPhone, iPad" src="http://gyazo.com/7c6b82b7e31568c52a4b267e4f91c78b.png" alt="" width="448" height="160" /></a><br />
<span id="more-983"></span><br />
or</p>
<div class="codecolorer-container objc geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:810px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br /></div></td><td><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">UIView <span style="color: #002200;">*</span>myTabView <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIView alloc<span style="color: #002200;">&#93;</span> initWithFrame<span style="color: #002200;">:</span>frame<span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp;CAGradientLayer <span style="color: #002200;">*</span>gradient <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>CAGradientLayer layer<span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp;gradient.frame <span style="color: #002200;">=</span> myTabView.bounds;<br />
&nbsp; &nbsp; &nbsp;gradient.colors <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/"><span style="color: #400080;">NSArray</span></a> arrayWithObjects<span style="color: #002200;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIColor colorWithRed<span style="color: #002200;">:</span><span style="color: #2400d9;">0.1</span> green<span style="color: #002200;">:</span><span style="color: #2400d9;">0.1</span> blue<span style="color: #002200;">:</span><span style="color: #2400d9;">0.1</span> alpha<span style="color: #002200;">:</span><span style="color: #2400d9;">0.8</span> <span style="color: #002200;">&#93;</span> CGColor<span style="color: #002200;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; , <span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIColor colorWithRed<span style="color: #002200;">:</span><span style="color: #2400d9;">0.1</span> green<span style="color: #002200;">:</span><span style="color: #2400d9;">0.1</span> blue<span style="color: #002200;">:</span><span style="color: #2400d9;">0.1</span> alpha<span style="color: #002200;">:</span><span style="color: #2400d9;">0.8</span> <span style="color: #002200;">&#93;</span> CGColor<span style="color: #002200;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; , <span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIColor colorWithRed<span style="color: #002200;">:</span><span style="color: #2400d9;">0.1</span> green<span style="color: #002200;">:</span><span style="color: #2400d9;">0.1</span> blue<span style="color: #002200;">:</span><span style="color: #2400d9;">0.1</span> alpha<span style="color: #002200;">:</span><span style="color: #2400d9;">0.8</span> <span style="color: #002200;">&#93;</span> CGColor<span style="color: #002200;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; , <span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIColor blackColor<span style="color: #002200;">&#93;</span> CGColor<span style="color: #002200;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; , <span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIColor blackColor<span style="color: #002200;">&#93;</span> CGColor<span style="color: #002200;">&#93;</span>, <span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#91;</span>myTabView.layer insertSublayer<span style="color: #002200;">:</span>gradient atIndex<span style="color: #002200;">:</span><span style="color: #2400d9;">0</span><span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>self.tabBarController tabBar<span style="color: #002200;">&#93;</span> insertSubview<span style="color: #002200;">:</span>myTabView &nbsp;atIndex<span style="color: #002200;">:</span><span style="color: #2400d9;">0</span><span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#91;</span>myTabView &nbsp;release<span style="color: #002200;">&#93;</span>;</div></td></tr></tbody></table></div>
<p>Result:<br />
<img class="alignnone" title="custom gradient in tabbar" src="http://gyazo.com/06c6dc8a8b574ecb3c2879c3d5226fc5.png" alt="" width="348" height="223" /></p>
<p>or, nice example with use Core Graphics to draw the gradient</p>
<div class="codecolorer-container objc geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:810px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br /></div></td><td><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>drawRect<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>CGRect<span style="color: #002200;">&#41;</span>rect <br />
<span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; CGContextRef currentContext <span style="color: #002200;">=</span> UIGraphicsGetCurrentContext<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; CGGradientRef glossGradient;<br />
&nbsp; &nbsp; CGColorSpaceRef rgbColorspace;<br />
&nbsp; &nbsp; <span style="color: #a61390;">size_t</span> num_locations <span style="color: #002200;">=</span> <span style="color: #2400d9;">2</span>;<br />
&nbsp; &nbsp; CGFloat locations<span style="color: #002200;">&#91;</span><span style="color: #2400d9;">2</span><span style="color: #002200;">&#93;</span> <span style="color: #002200;">=</span> <span style="color: #002200;">&#123;</span> <span style="color: #2400d9;">0.0</span>, <span style="color: #2400d9;">1.0</span> <span style="color: #002200;">&#125;</span>;<br />
&nbsp; &nbsp; CGFloat components<span style="color: #002200;">&#91;</span><span style="color: #2400d9;">8</span><span style="color: #002200;">&#93;</span> <span style="color: #002200;">=</span> <span style="color: #002200;">&#123;</span> <span style="color: #2400d9;">1.0</span>, <span style="color: #2400d9;">1.0</span>, <span style="color: #2400d9;">1.0</span>, <span style="color: #2400d9;">0.35</span>, &nbsp;<span style="color: #11740a; font-style: italic;">// Start color</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #2400d9;">1.0</span>, <span style="color: #2400d9;">1.0</span>, <span style="color: #2400d9;">1.0</span>, <span style="color: #2400d9;">0.06</span> <span style="color: #002200;">&#125;</span>; <span style="color: #11740a; font-style: italic;">// End color</span><br />
<br />
&nbsp; &nbsp; rgbColorspace <span style="color: #002200;">=</span> CGColorSpaceCreateDeviceRGB<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span>;<br />
&nbsp; &nbsp; glossGradient <span style="color: #002200;">=</span> CGGradientCreateWithColorComponents<span style="color: #002200;">&#40;</span>rgbColorspace, components, locations, num_locations<span style="color: #002200;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; CGRect currentBounds <span style="color: #002200;">=</span> self.bounds;<br />
&nbsp; &nbsp; CGPoint topCenter <span style="color: #002200;">=</span> CGPointMake<span style="color: #002200;">&#40;</span>CGRectGetMidX<span style="color: #002200;">&#40;</span>currentBounds<span style="color: #002200;">&#41;</span>, 0.0f<span style="color: #002200;">&#41;</span>;<br />
&nbsp; &nbsp; CGPoint midCenter <span style="color: #002200;">=</span> CGPointMake<span style="color: #002200;">&#40;</span>CGRectGetMidX<span style="color: #002200;">&#40;</span>currentBounds<span style="color: #002200;">&#41;</span>, CGRectGetMidY<span style="color: #002200;">&#40;</span>currentBounds<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span>;<br />
&nbsp; &nbsp; CGContextDrawLinearGradient<span style="color: #002200;">&#40;</span>currentContext, glossGradient, topCenter, midCenter, <span style="color: #2400d9;">0</span><span style="color: #002200;">&#41;</span>;<br />
<br />
&nbsp; &nbsp; CGGradientRelease<span style="color: #002200;">&#40;</span>glossGradient<span style="color: #002200;">&#41;</span>;<br />
&nbsp; &nbsp; CGColorSpaceRelease<span style="color: #002200;">&#40;</span>rgbColorspace<span style="color: #002200;">&#41;</span>; <br />
<span style="color: #002200;">&#125;</span></div></td></tr></tbody></table></div>
<p><a href="http://developer.apple.com/iphone/library/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_shadings/dq_shadings.html#//apple_ref/doc/uid/TP30001066-CH207-TPXREF101" target="_blank">Many documentations</a></p>
<p><noindex><br />
<a target="_blank" href="http://stackoverflow.com/questions/422066/gradients-on-uiview-and-uilabels-on-iphone">resource</a></noindex></p>
]]></content:encoded>
			<wfw:commentRss>http://www.developers-life.com/make-gradient-on-iphoneipad.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom change orientation</title>
		<link>http://www.developers-life.com/custom-change-orientation.html</link>
		<comments>http://www.developers-life.com/custom-change-orientation.html#comments</comments>
		<pubDate>Tue, 12 Jan 2010 04:34:31 +0000</pubDate>
		<dc:creator>Vladimir Boychentsov</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[UIInterface]]></category>
		<category><![CDATA[UIKit]]></category>
		<category><![CDATA[UITabBar]]></category>

		<guid isPermaLink="false">http://www.developers-life.com/?p=767</guid>
		<description><![CDATA[Solution for change orientation with uitabbar and others exeptions. 12&#91;&#91;UIDevice currentDevice&#93; beginGeneratingDeviceOrientationNotifications&#93;; &#160; &#160; &#160; &#160; &#160; &#91;&#91;NSNotificationCenter defaultCenter&#93; addObserver:self selector:@selector&#40;didOrientation:&#41; name:@&#34;UIDeviceOrientationDidChangeNotification&#34; object:nil&#93;; And method 1234567891011121314- &#40;void&#41; didOrientation: &#40;id&#41;object &#123; &#160; &#160; &#160; &#160; &#160; &#160;UIInterfaceOrientation interfaceOrientation = &#91;&#91;object object&#93; orientation&#93;; &#160; &#160; &#160;if &#40;interfaceOrientation == UIInterfaceOrientationPortrait &#124;&#124; interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown&#41; &#123; &#160; &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Solution for change orientation with uitabbar and others exeptions.</p>
<div class="codecolorer-container objc geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:810px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIDevice currentDevice<span style="color: #002200;">&#93;</span> beginGeneratingDeviceOrientationNotifications<span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNotificationCenter_Class/"><span style="color: #400080;">NSNotificationCenter</span></a> defaultCenter<span style="color: #002200;">&#93;</span> addObserver<span style="color: #002200;">:</span>self selector<span style="color: #002200;">:</span><span style="color: #a61390;">@selector</span><span style="color: #002200;">&#40;</span>didOrientation<span style="color: #002200;">:</span><span style="color: #002200;">&#41;</span> name<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;UIDeviceOrientationDidChangeNotification&quot;</span> object<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;</div></td></tr></tbody></table></div>
<p>And method </p>
<div class="codecolorer-container objc geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:810px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br /></div></td><td><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> didOrientation<span style="color: #002200;">:</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span>object <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp;UIInterfaceOrientation interfaceOrientation <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>object object<span style="color: #002200;">&#93;</span> orientation<span style="color: #002200;">&#93;</span>;<br />
<br />
&nbsp; &nbsp; &nbsp;<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>interfaceOrientation <span style="color: #002200;">==</span> UIInterfaceOrientationPortrait || interfaceOrientation <span style="color: #002200;">==</span> UIInterfaceOrientationPortraitUpsideDown<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; self.view.transform <span style="color: #002200;">=</span> CGAffineTransformMakeRotation<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span><span style="color: #002200;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#125;</span> <span style="color: #a61390;">else</span> <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>interfaceOrientation <span style="color: #002200;">==</span> UIInterfaceOrientationLandscapeRight <span style="color: #002200;">&#41;</span><span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; self.view.transform <span style="color: #002200;">=</span> CGAffineTransformMakeRotation<span style="color: #002200;">&#40;</span>M_PI <span style="color: #002200;">*</span> .5<span style="color: #002200;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#125;</span> <span style="color: #a61390;">else</span> <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; self.view.transform <span style="color: #002200;">=</span> CGAffineTransformMakeRotation<span style="color: #002200;">&#40;</span>M_PI <span style="color: #002200;">*</span> <span style="color: #002200;">-</span>.5<span style="color: #002200;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#125;</span><br />
<span style="color: #002200;">&#125;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://www.developers-life.com/custom-change-orientation.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hide UITabBarController/UITabBar with animation.</title>
		<link>http://www.developers-life.com/hide-uitabbarcontrolleruitabbar-with-animation.html</link>
		<comments>http://www.developers-life.com/hide-uitabbarcontrolleruitabbar-with-animation.html#comments</comments>
		<pubDate>Fri, 20 Nov 2009 05:28:56 +0000</pubDate>
		<dc:creator>Vladimir Boychentsov</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[UIKit]]></category>
		<category><![CDATA[UITabBar]]></category>
		<category><![CDATA[UITabBarController]]></category>
		<category><![CDATA[Кодинг]]></category>

		<guid isPermaLink="false">http://www.developers-life.com/?p=672</guid>
		<description><![CDATA[Hide UITabBarController/UITabBar with animation. 123456789101112131415161718192021222324252627282930313233BOOL hiddenTabBar; UITabBarController *tabBarController; - &#40;void&#41; hideTabBar &#123; &#160; &#160; &#160; &#160; &#160; &#160;&#91;UIView beginAnimations:nil context:NULL&#93;; &#160; &#160; &#160;&#91;UIView setAnimationDuration:0.4&#93;; &#160; &#160; &#160;for&#40;UIView *view in tabBarController.view.subviews&#41; &#160; &#160; &#160;&#123; &#160; &#160; &#160; &#160; &#160; CGRect _rect = view.frame; &#160; &#160; &#160; &#160; &#160; if&#40;&#91;view isKindOfClass:&#91;UITabBar class&#93;&#93;&#41; &#160; &#160; &#160; &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Hide UITabBarController/UITabBar with animation.</p>
<div class="codecolorer-container objc geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:810px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br /></div></td><td><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a61390;">BOOL</span> hiddenTabBar;<br />
UITabBarController <span style="color: #002200;">*</span>tabBarController;<br />
<br />
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> hideTabBar <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#91;</span>UIView beginAnimations<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span> context<span style="color: #002200;">:</span><span style="color: #a61390;">NULL</span><span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#91;</span>UIView setAnimationDuration<span style="color: #002200;">:</span><span style="color: #2400d9;">0.4</span><span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp;<span style="color: #a61390;">for</span><span style="color: #002200;">&#40;</span>UIView <span style="color: #002200;">*</span>view <span style="color: #a61390;">in</span> tabBarController.view.subviews<span style="color: #002200;">&#41;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CGRect _rect <span style="color: #002200;">=</span> view.frame;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span>view isKindOfClass<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>UITabBar class<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>hiddenTabBar<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _rect.origin.y <span style="color: #002200;">=</span> <span style="color: #2400d9;">431</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #002200;">&#91;</span>view setFrame<span style="color: #002200;">:</span>_rect<span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#125;</span> <span style="color: #a61390;">else</span> <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _rect.origin.y <span style="color: #002200;">=</span> <span style="color: #2400d9;">480</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #002200;">&#91;</span>view setFrame<span style="color: #002200;">:</span>_rect<span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #002200;">&#125;</span> <span style="color: #a61390;">else</span> <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>hiddenTabBar<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _rect.size.height <span style="color: #002200;">=</span> <span style="color: #2400d9;">431</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #002200;">&#91;</span>view setFrame<span style="color: #002200;">:</span>_rect<span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#125;</span> <span style="color: #a61390;">else</span> <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _rect.size.height <span style="color: #002200;">=</span> <span style="color: #2400d9;">480</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #002200;">&#91;</span>view setFrame<span style="color: #002200;">:</span>_rect<span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #002200;">&#125;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#125;</span>&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#91;</span>UIView commitAnimations<span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp;hiddenTabBar <span style="color: #002200;">=</span> <span style="color: #002200;">!</span>hiddenTabBar;<br />
<span style="color: #002200;">&#125;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://www.developers-life.com/hide-uitabbarcontrolleruitabbar-with-animation.html/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Rewrite UITabBar and UITabBarItem iPhone</title>
		<link>http://www.developers-life.com/rewrite-uitabbar-and-uitabbaritem-iphone.html</link>
		<comments>http://www.developers-life.com/rewrite-uitabbar-and-uitabbaritem-iphone.html#comments</comments>
		<pubDate>Thu, 08 Oct 2009 09:58:16 +0000</pubDate>
		<dc:creator>Vladimir Boychentsov</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[Private]]></category>
		<category><![CDATA[Rewrite]]></category>
		<category><![CDATA[UITabBar]]></category>

		<guid isPermaLink="false">http://www.developers-life.com/?p=541</guid>
		<description><![CDATA[Вариант 1 Вкратце о чем нужно помнить! Самое главное, если вы используете какие-то переменные из приват фреймверков и для них не прописаны property, обязательно пропишите! Иначе при компиляции на эти переменные будет ругаться компилятор к примеру так: 1234&#34;_OBJC_IVAR_$_UITabBarItem._selectedImage&#34;, referenced from: _OBJC_IVAR_$_UITabBarItem._selectedImage$non_lazy_ptr in UICategory.o ld: symbol&#40;s&#41; not found collect2: ld returned 1 exit status Рассказывать тут [...]]]></description>
			<content:encoded><![CDATA[<p>Вариант 1</p>
<p>Вкратце о чем нужно помнить!<br />
Самое главное, если вы используете какие-то переменные из приват фреймверков и для них не прописаны property, обязательно пропишите! Иначе при компиляции на эти переменные будет ругаться компилятор к примеру так:</p>
<div class="codecolorer-container objc geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:810px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #bf1d1a;">&quot;_OBJC_IVAR_$_UITabBarItem._selectedImage&quot;</span>, referenced from<span style="color: #002200;">:</span><br />
_OBJC_IVAR_$_UITabBarItem._selectedImage$non_lazy_ptr <span style="color: #a61390;">in</span> UICategory.o<br />
ld<span style="color: #002200;">:</span> symbol<span style="color: #002200;">&#40;</span>s<span style="color: #002200;">&#41;</span> not found<br />
collect2<span style="color: #002200;">:</span> ld returned <span style="color: #2400d9;">1</span> <a href="http://www.opengroup.org/onlinepubs/009695399/functions/exit.html"><span style="color: #a61390;">exit</span></a> status</div></td></tr></tbody></table></div>
<p>Рассказывать тут не очем кроме quartz, но о нем я расскажу в следующем посте подробнее, как появится время. Смотрите исходники, кода немного :), основные файлы ExtendsForTabBar.h и m. Исходники ниже.</p>
<p>Вариант 2</p>
<p>Можно взять за основу UITabBar и создать свой объект а не переписывать методы существующего. Хотя в конечном итоге и в этом случае мы переписываем методы.</p>
<p>Добавив два файла пустого NSObject к примеру с именем MyTabBar. В файле h вместо NSObject напишем UITabBar.<br />
В m файе напишем:</p>
<div class="codecolorer-container objc geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:810px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> drawRect<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>CGRect<span style="color: #002200;">&#41;</span>rect <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp;self.frame <span style="color: #002200;">=</span> CGRectMake<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">409</span>, <span style="color: #2400d9;">320</span>, <span style="color: #2400d9;">71</span><span style="color: #002200;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp;UIImage <span style="color: #002200;">*</span>img &nbsp;<span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>UIImage imageNamed<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;tabbarbg2.png&quot;</span><span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#91;</span>img drawInRect<span style="color: #002200;">:</span>CGRectMake<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">320</span>, <span style="color: #2400d9;">71</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#93;</span>;<br />
<span style="color: #002200;">&#125;</span></div></td></tr></tbody></table></div>
<p>Далее в MainWindow.xib сделать все как на скриншотах, сохранить и скомпилировать.</p>
<p><a href="http://www.developers-life.com/wp-content/uploads/2009/10/1.png" target="_blank"><img src="http://www.developers-life.com/wp-content/uploads/2009/10/1-286x300.png" alt="" title="1" width="286" height="300" class="alignnone size-medium wp-image-542" /></a><br />
<br />
<a href="http://www.developers-life.com/wp-content/uploads/2009/10/2.png" target="_blank"><img src="http://www.developers-life.com/wp-content/uploads/2009/10/2-284x300.png" alt="" title="2" width="284" height="300" class="alignnone size-medium wp-image-543" /></a></p>
<p><a href="http://depositfiles.com/files/fqfj8gv9a" target="_blank">Исходники</a></p>
<p>Чтоб найти еще что-то подобное достаточно набрать: &#8220;Custom Colors UITabBar UITabBarItem&#8221;, &#8220;How to custom UITabBar&#8221; и подобное.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.developers-life.com/rewrite-uitabbar-and-uitabbaritem-iphone.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

