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 Development

Reply
 
LinkBack Thread Tools Display Modes
Old 11-03-2011, 05:05 PM   #26 (permalink)
Just helping out.
 
Domele's Avatar
 
Join Date: Feb 2011
Posts: 2,565
Domele is on a distinguished road
Default

The method was only introduced in iOS 5, there is no way to truly adjust the screen's brightness in iOS 5-.
__________________
If you are looking for a quality developer, I'm your man. Give me a PM if you are interested.

New app - See screenshots and details at www.globaclock.com.

If you want to thank me, click the link. Every click counts. If you want to do more, buy my app. A link is available on my website. Thanks.
Domele is online now   Reply With Quote
Old 11-21-2011, 03:41 PM   #27 (permalink)
C++ Developer
 
Join Date: Jan 2009
Location: Florida
Posts: 4
bailon is on a distinguished road
Default How to set the brightness

Quote:
Originally Posted by jimmyyjlee View Post
hi
can you tell me which method can adjust brightness if iOS 4.x, 3.x ?
thank you

jimmy
You get the brightness:
float fBrightness = [UIScreen mainScreen].brightness;

and you set the brightness
[[UIScreen mainScreen]setBrightness:fBrightness];

The values are from 0 to 1
bailon is offline   Reply With Quote
Old 11-21-2011, 05:14 PM   #28 (permalink)
Just helping out.
 
Domele's Avatar
 
Join Date: Feb 2011
Posts: 2,565
Domele is on a distinguished road
Default

Those methods were only introduced in iOS 5.0. There is no way to truly adjust the screen brightness pre iOS5. The only way is to artificially do it by layering a UIView object with a black background and lowering the opacity.
__________________
If you are looking for a quality developer, I'm your man. Give me a PM if you are interested.

New app - See screenshots and details at www.globaclock.com.

If you want to thank me, click the link. Every click counts. If you want to do more, buy my app. A link is available on my website. Thanks.
Domele is online now   Reply With Quote
Old 11-21-2011, 05:28 PM   #29 (permalink)
C++ Developer
 
Join Date: Jan 2009
Location: Florida
Posts: 4
bailon is on a distinguished road
Default

Quote:
Originally Posted by Domele View Post
Those methods were only introduced in iOS 5.0. There is no way to truly adjust the screen brightness pre iOS5. The only way is to artificially do it by layering a UIView object with a black background and lowering the opacity.
Domele, you are absolutely right. These methods are only present in iOS 5 anybody using a previous iOS version should check for the presence of this method by using:

if([[UIScreen mainScreen] respondsToSelector:@selector(setBrightness])
[[UIScreen mainScreen]setBrightness:fBrightness];
bailon 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: 341
10 members and 331 guests
7twenty7, chiataytuday, condor304, Creativ, Domele, dreamdash3, laureix68, LEARN2MAKE, mistergreen2011, Paul Slocum
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,660
Threads: 94,119
Posts: 402,896
Top Poster: BrianSlick (7,990)
Welcome to our newest member, laureix68
Powered by vBadvanced CMPS v3.1.0

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