Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Tutorials > Tutorial Discussion

Reply
 
LinkBack Thread Tools Display Modes
Old 02-12-2009, 04:50 PM   #1 (permalink)
New Member
 
Join Date: Feb 2009
Posts: 1
bekon is on a distinguished road
Default Easy Tutorial on Switching Views questions

Hey i completed the tutorial and so now i have 5 Views. I have 4 buttons.
Main view->
Home View -> Start View
-> Settings View
-> Instructions View

first thing i was wondering is how instead of making different function for each button, how would it be possible to just do it with one functions. just the the value from the button or something and pass it to the switchview function.

2nd thing is how would i set the start view and the other subviews to be displayed horizontally when they load, not with the accelometer, just initially be horizontal layout. Thanks.
bekon is offline   Reply With Quote
Old 05-27-2009, 05:43 AM   #2 (permalink)
Registered Member
 
Join Date: Apr 2009
Posts: 118
lexy0202 is on a distinguished road
Default

Hi
In case you already haven't found out, do this:
Right click on your "info.plist" under resources and click Open as > Source Code File
Then right before it says </dict> at the end, put these to lines of code:
Code:
<key>UIInterfaceOrientation</key>
<string>UIInterfaceOrientationLandscapeRight</string>
Then find your applicationDidFinishLaunching method inside your AppDelegate.m and add this line of code after the [window makeKeyandVisibile] line
Code:
[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight];
Finally implement the shouldAutorate.... blah blah blah method (that's a technical term) in your ViewController (make sure it's the view CONTROLLER)
and replace the return with this
Code:
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
That should help!

Alex
lexy0202 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Stats
Members: 175,696
Threads: 94,138
Posts: 402,957
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jasper_muc
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:50 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0