Home News Forum Social Networking Support Us Advertise

Spanish Lesson 1 ($1.99)

aWake!Gently ($1.99)

The Bird & The Snail - Knock Knock - Deluxe ($4.99)

Match-It Trains ($0.99)

Tangled ($0.99)

iFlatter ($0.99)

The 15 puzzle ($0.99)

Tap Forms Database ($8.99)

Higher or Lower Card Game (Hi Lo) ($0.99)

Red Pixel ($0.99)

Time-Shift Radio ($0.99)

Want your application advertised here? Only $10/week!

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-04-2009, 08:24 PM   #1 (permalink)
Junior Member
 
Join Date: Jan 2009
Posts: 21
Rep Power: 0
vitlance is on a distinguished road
Default Turning iPhone screen off or sleep

Hi, how can i turn the iphone screen off or to make it sleep programaticly from the app?
vitlance is offline   Reply With Quote
Old 01-05-2009, 12:42 AM   #2 (permalink)
Senior Member
 
Join Date: Jul 2008
Posts: 316
Rep Power: 0
tawpie is an unknown quantity at this point
Default

you might try setting the window alpha to zero, but the app won't actually sleep until the phone goes to sleep by itself. Then you have to figure out how to know when to reset the alpha which is probably a bigger problem! Lest your user tries to wake their phone and is presented with a blank screen...

Probably not a great idea actually.
tawpie is offline   Reply With Quote
Old 01-05-2009, 02:25 AM   #3 (permalink)
Member
 
Join Date: Nov 2008
Posts: 74
Rep Power: 1
SkylarEC is on a distinguished road
Default

Setting the window alpha won't do what you are thinking it will do. YOu can not turn the screen on/off because it is against the SDK rules. Another option would be to turn the screen brightness down (GraphicsServices), but that is also against Apple's rules.

Basically, there's nothing you can do without barring an AppStore release.
SkylarEC is offline   Reply With Quote
Old 01-05-2009, 03:48 AM   #4 (permalink)
Junior Member
 
Join Date: Jan 2009
Posts: 21
Rep Power: 0
vitlance is on a distinguished road
Default

Okey, thanks guys... but i have one more noob question How to acces to window's alpha parameter from the view?

Code:
window.alpha = 0;
It gives me an error
vitlance is offline   Reply With Quote
Old 01-05-2009, 11:54 AM   #5 (permalink)
Senior Member
 
Join Date: Jul 2008
Posts: 316
Rep Power: 0
tawpie is an unknown quantity at this point
Default

it might be easier to set the alpha of each of your views to 0, rather than the window itself. I think (haven't tried this) that you can blank out all of the views by setting the alpha of the root view. Make the window.backgroundColor black... :-)
tawpie 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


» Online Users: 256
26 members and 230 guests
Artem, brendand, crossfire, davek, DenVog, DGuy, enfamus, FlyingDiver, gbh, iBud, jonahgabriel, jrsiqueira, kaleman, Kalimba, lildragon, martinn, mnemonic_fx, mohrt, qaziatiq, shabzcohelp, Sicga, SpikeyUK, talguy, tashev, thorx, warmi
Most users ever online was 779, 05-11-2009 at 09:55 AM.
» Stats
Members: 8,229
Threads: 20,197
Posts: 90,213
Top Poster: RickMaddy (2,121)
Welcome to our newest member, jrsiqueira
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:08 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0