<?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: Semi-Modal (Transparent) Dialogs on the iPhone</title>
	<atom:link href="http://ramin.firoozye.com/2009/09/29/semi-modal-transparent-dialogs-on-the-iphone/feed/" rel="self" type="application/rss+xml" />
	<link>http://ramin.firoozye.com/2009/09/29/semi-modal-transparent-dialogs-on-the-iphone/</link>
	<description>Talk Funnel: Ramin Firoozye&#039;s (occasional) Public Whisperings</description>
	<lastBuildDate>Sun, 21 Aug 2011 07:01:40 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>By: Crystian</title>
		<link>http://ramin.firoozye.com/2009/09/29/semi-modal-transparent-dialogs-on-the-iphone/comment-page-1/#comment-1771</link>
		<dc:creator>Crystian</dc:creator>
		<pubDate>Sun, 21 Aug 2011 07:01:40 +0000</pubDate>
		<guid isPermaLink="false">http://ramin.firoozye.com/?p=190#comment-1771</guid>
		<description>Great job dude!
just for who is reading this post, for me it worked better this way:

- (void) showModal:(UIView*) modalView {
    CGSize offSize = self.view.frame.size;   
    CGPoint offScreenCenter = CGPointMake(offSize.width / 2.0, offSize.height * 1.5);   
    CGPoint realCenter = CGPointMake(offSize.width / 2.0, offSize.height / 2.0);
    modalView.center = offScreenCenter; 
    [self.view addSubview:modalView];
    [UIView beginAnimations:nil context:nil];   
    [UIView setAnimationDuration:0.7];  
    modalView.center = realCenter;   
    [UIView commitAnimations]; 
}

and in the modalView:

- (void)viewDidLoad {
    [super viewDidLoad];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged:) name:UIDeviceOrientationDidChangeNotification object:nil];
}

-(void) orientationChanged:(NSNotification *)notification {
    UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
    if (orientation == UIDeviceOrientationLandscapeLeft &#124;&#124; 
        orientation == UIDeviceOrientationLandscapeRight)
        self.view.frame = CGRectMake(0, 110, 1024, 599); // the size that you want
        else
        self.view.frame = CGRectMake(0, 280, 768, 599);// the size that you want
}

- (void)viewDidUnload {    
    [[NSNotificationCenter defaultCenter] removeObserver:self name:UIDeviceOrientationDidChangeNotification object:nil];    
    [super viewDidUnload];
}</description>
		<content:encoded><![CDATA[<p>Great job dude!<br />
just for who is reading this post, for me it worked better this way:</p>
<p>- (void) showModal:(UIView*) modalView {<br />
    CGSize offSize = self.view.frame.size;<br />
    CGPoint offScreenCenter = CGPointMake(offSize.width / 2.0, offSize.height * 1.5);<br />
    CGPoint realCenter = CGPointMake(offSize.width / 2.0, offSize.height / 2.0);<br />
    modalView.center = offScreenCenter;<br />
    [self.view addSubview:modalView];<br />
    [UIView beginAnimations:nil context:nil];<br />
    [UIView setAnimationDuration:0.7];<br />
    modalView.center = realCenter;<br />
    [UIView commitAnimations];<br />
}</p>
<p>and in the modalView:</p>
<p>- (void)viewDidLoad {<br />
    [super viewDidLoad];<br />
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged:) name:UIDeviceOrientationDidChangeNotification object:nil];<br />
}</p>
<p>-(void) orientationChanged:(NSNotification *)notification {<br />
    UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];<br />
    if (orientation == UIDeviceOrientationLandscapeLeft ||<br />
        orientation == UIDeviceOrientationLandscapeRight)<br />
        self.view.frame = CGRectMake(0, 110, 1024, 599); // the size that you want<br />
        else<br />
        self.view.frame = CGRectMake(0, 280, 768, 599);// the size that you want<br />
}</p>
<p>- (void)viewDidUnload {<br />
    [[NSNotificationCenter defaultCenter] removeObserver:self name:UIDeviceOrientationDidChangeNotification object:nil];<br />
    [super viewDidUnload];<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: david</title>
		<link>http://ramin.firoozye.com/2009/09/29/semi-modal-transparent-dialogs-on-the-iphone/comment-page-1/#comment-1759</link>
		<dc:creator>david</dc:creator>
		<pubDate>Sat, 09 Jul 2011 03:59:01 +0000</pubDate>
		<guid isPermaLink="false">http://ramin.firoozye.com/?p=190#comment-1759</guid>
		<description>this works great, but I am not familiar with transform to get this to work in landscape mode.  could anybody point me in the right direction?  thanks.</description>
		<content:encoded><![CDATA[<p>this works great, but I am not familiar with transform to get this to work in landscape mode.  could anybody point me in the right direction?  thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ramin</title>
		<link>http://ramin.firoozye.com/2009/09/29/semi-modal-transparent-dialogs-on-the-iphone/comment-page-1/#comment-832</link>
		<dc:creator>ramin</dc:creator>
		<pubDate>Thu, 30 Dec 2010 08:51:49 +0000</pubDate>
		<guid isPermaLink="false">http://ramin.firoozye.com/?p=190#comment-832</guid>
		<description>@nathan It&#039;s only for horizontal view but it should be easy to catch the orientation change event and set the transform on the modal view to have it rotate. See my other comment for one way to watch for orientation change. This way it will work even if the modal view is not part of a UIViewController chain. You&#039;ll want to remember to remove it as an observer when dismissing the modal.</description>
		<content:encoded><![CDATA[<p>@nathan It&#8217;s only for horizontal view but it should be easy to catch the orientation change event and set the transform on the modal view to have it rotate. See my other comment for one way to watch for orientation change. This way it will work even if the modal view is not part of a UIViewController chain. You&#8217;ll want to remember to remove it as an observer when dismissing the modal.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ramin</title>
		<link>http://ramin.firoozye.com/2009/09/29/semi-modal-transparent-dialogs-on-the-iphone/comment-page-1/#comment-831</link>
		<dc:creator>ramin</dc:creator>
		<pubDate>Thu, 30 Dec 2010 08:49:01 +0000</pubDate>
		<guid isPermaLink="false">http://ramin.firoozye.com/?p=190#comment-831</guid>
		<description>@AD: I was trying to describe a general technique instead of a specific type of modal window. You may want to take a look at Nick&#039;s post at http://bit.ly/9HqgKV for some code examples.</description>
		<content:encoded><![CDATA[<p>@AD: I was trying to describe a general technique instead of a specific type of modal window. You may want to take a look at Nick&#8217;s post at <a href="http://bit.ly/9HqgKV" rel="nofollow">http://bit.ly/9HqgKV</a> for some code examples.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ramin</title>
		<link>http://ramin.firoozye.com/2009/09/29/semi-modal-transparent-dialogs-on-the-iphone/comment-page-1/#comment-830</link>
		<dc:creator>ramin</dc:creator>
		<pubDate>Thu, 30 Dec 2010 08:47:02 +0000</pubDate>
		<guid isPermaLink="false">http://ramin.firoozye.com/?p=190#comment-830</guid>
		<description>@stan: To get it to show above everything else the semi-modal dialog needs to be added as a child of the top-level window and moved in front of all other children of the window (including tabbars and navigation controllers).</description>
		<content:encoded><![CDATA[<p>@stan: To get it to show above everything else the semi-modal dialog needs to be added as a child of the top-level window and moved in front of all other children of the window (including tabbars and navigation controllers).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ramin</title>
		<link>http://ramin.firoozye.com/2009/09/29/semi-modal-transparent-dialogs-on-the-iphone/comment-page-1/#comment-829</link>
		<dc:creator>ramin</dc:creator>
		<pubDate>Thu, 30 Dec 2010 08:42:36 +0000</pubDate>
		<guid isPermaLink="false">http://ramin.firoozye.com/?p=190#comment-829</guid>
		<description>@nick It shouldn&#039;t be too hard to set up the class as an observer for interface rotation notification via something like:

&lt;code&gt;[[NSNotificationCenter defaultCenter] addObserver:self 
            selector:@selector(orientationChanged:) 
            name:UIDeviceOrientationDidChangeNotification object:nil];
&lt;/code&gt;

Then set the &lt;code&gt;transform&lt;/code&gt; angle of the view to rotate accordingly.</description>
		<content:encoded><![CDATA[<p>@nick It shouldn&#8217;t be too hard to set up the class as an observer for interface rotation notification via something like:</p>
<p><code>[[NSNotificationCenter defaultCenter] addObserver:self<br />
            selector:@selector(orientationChanged:)<br />
            name:UIDeviceOrientationDidChangeNotification object:nil];<br />
</code></p>
<p>Then set the <code>transform</code> angle of the view to rotate accordingly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ramin</title>
		<link>http://ramin.firoozye.com/2009/09/29/semi-modal-transparent-dialogs-on-the-iphone/comment-page-1/#comment-828</link>
		<dc:creator>ramin</dc:creator>
		<pubDate>Thu, 30 Dec 2010 08:34:41 +0000</pubDate>
		<guid isPermaLink="false">http://ramin.firoozye.com/?p=190#comment-828</guid>
		<description>Thanks for the link Nathan. Good work!</description>
		<content:encoded><![CDATA[<p>Thanks for the link Nathan. Good work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: spstanley</title>
		<link>http://ramin.firoozye.com/2009/09/29/semi-modal-transparent-dialogs-on-the-iphone/comment-page-1/#comment-817</link>
		<dc:creator>spstanley</dc:creator>
		<pubDate>Sun, 21 Nov 2010 14:37:20 +0000</pubDate>
		<guid isPermaLink="false">http://ramin.firoozye.com/?p=190#comment-817</guid>
		<description>There&#039;s a problem when the view is added on a rotated device with autorotation allowed.  The fix is... unpleasant.  It involves applying a transform to the view and then if you want it to slide in from a specific direction, you need to mess with the offScreenCenter based on which way the the device is oriented.</description>
		<content:encoded><![CDATA[<p>There&#8217;s a problem when the view is added on a rotated device with autorotation allowed.  The fix is&#8230; unpleasant.  It involves applying a transform to the view and then if you want it to slide in from a specific direction, you need to mess with the offScreenCenter based on which way the the device is oriented.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nathan</title>
		<link>http://ramin.firoozye.com/2009/09/29/semi-modal-transparent-dialogs-on-the-iphone/comment-page-1/#comment-808</link>
		<dc:creator>Nathan</dc:creator>
		<pubDate>Tue, 19 Oct 2010 02:50:27 +0000</pubDate>
		<guid isPermaLink="false">http://ramin.firoozye.com/?p=190#comment-808</guid>
		<description>I used this idea and turned it into a few classes to present Semi-Modal dialogs in an easy way.

The code is up on github, see this post here: http://bit.ly/9HqgKV</description>
		<content:encoded><![CDATA[<p>I used this idea and turned it into a few classes to present Semi-Modal dialogs in an easy way.</p>
<p>The code is up on github, see this post here: <a href="http://bit.ly/9HqgKV" rel="nofollow">http://bit.ly/9HqgKV</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mark</title>
		<link>http://ramin.firoozye.com/2009/09/29/semi-modal-transparent-dialogs-on-the-iphone/comment-page-1/#comment-805</link>
		<dc:creator>mark</dc:creator>
		<pubDate>Sat, 09 Oct 2010 13:15:18 +0000</pubDate>
		<guid isPermaLink="false">http://ramin.firoozye.com/?p=190#comment-805</guid>
		<description>Crap, this does not rotate!</description>
		<content:encoded><![CDATA[<p>Crap, this does not rotate!</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

Served from: ramin.firoozye.com @ 2012-02-07 14:14:51 -->
