This question already has answers here:
Is there a way of adjusting the screen brightness programmatically?
(3 answers)
Closed 9 years ago.
I want to build an iOs app like f.lux.
It changes the screen brightness of device based on daytime.
I know I have to jailbreak my device. But I don't know how to implement this app.
Please suggest me any useful API to do that.
Thanks in advance.
iOS already has that system-wide feature built-in: see Settings > Brightness & Wallpaper, under Auto-Brightness:
Although it is possible to programmatically control the device's brightness, there is not a public API for determining the outside light, so this is functionality that the OS handles.
Try this (iOS5 and greater only):
[[UIScreen mainScreen] setBrightness:1.0];
From related question: Adjust the brightness of the screen through code
Go through the brightness property of UIScreen which is a new API available after IOS5.
Related
This question already has answers here:
How to resize the image programmatically in objective-c in iphone
(10 answers)
Closed 9 years ago.
I created an app of target to iPad and now i want to make an universal app and the time for adjusting my iPad app to iPhone would decrease significantly.
I have set of images (more than 200 images) on iPad dimensions and i want to convert that to iPhone dimension with clarity using objective c (Programmically). I won't need to change iPhone dimension manually, add to Xcode. Because size will increase. if there is an answer for this question.
Thanks.
Kindly look at this other post in stackOverflow
If you want a pixel wise re-sampling refer here and here
hope that helps.
This question already has answers here:
Is there a way to adjust the torch/flash brightness level on an iOS device?
(3 answers)
Closed 8 years ago.
I want create simple application such as android app.
Camera properties have only "on" / "off" flash as i known.
Can i change flash brightness? Maybe some libs will help me?
You can from iOS 6.0 on.
Documentation is your friend.
The method you are looking for is setTorchModeOnWithLevel:error:
Also make sure to read the discussion part of method description. Not all devices support setting the torchlevel.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How do I prevent the iPhone screen from dimming or turning off while my application is running?
I am working on a timer app and was wondering if there is a way to tell iOS not to start the screensaver when the app is idle (e.g. timer laying on the table).
I would also like to keep the screen brightness at maximum level.
Any suggestion?
For disabling the screensaver, try this:
[UIApplication sharedApplication].idleTimerDisabled = YES;
For adjusting the brightness of the screen (iOS5 and later only, previously there was no public API for this):
[[UIScreen mainScreen] setBrightness:1.0];
This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
Retina display VS normal display color difference
My designer has provided me with an iPhone app design using photoshop.
The colours work great on the simulator and iMac monitor.
But as soon as those designs get to the device, everything looks off.
I know/am told this has something to with how the iPhone displays colour.
What I think I have to do is find a colour that works on the device using something like LiveView.
The problem is, the colours are perfect on the iPhone5. But for every other device, they are off. Do I have to pick and choose a colour for each device?
Is this a common problem with colours on the iPhone? Or just some colours?
Any help would be much appreciated. Thanks.
Colors will appear differently on any screen - there are some wonderful tools like XScope that you and your visual designer should be using to preview visual designs on-device while designing in Photoshop.
If your designer is comparing what's on their laptop to what's in your coded app, then they're doing it wrong: they need a way to preview their PSDs on-device as they work. What you see on your iMac won't match what you'll see on-device.
In addition, Panic's made a wonderful color picker tool that you should look at. It plugs into OS X's standard color picker, but gives you the ability to generate UIColor code. You can find the tool here: http://panic.com/~wade/picker/
This is regarding the question: Turn off display in iPhone OS (iOS)
As alternative to turning off display, I am looking for a way to dim screen as much as possible.
I found following questions:
How to change brightness in iOS 5 app?
Make the iPhone Screen Dim
And this documentation:
http://developer.apple.com/library/IOs/#documentation/UIKit/Reference/UIScreen_Class/Reference/UIScreen.html
Per this questions/documentation, I should be able to do this to dim screen additional to decreasing backlight.
[[UIScreen mainScreen] setWantsSoftwareDimming:YES];
I tried this code on my iPad 2 (iOS 6.0). However, I didn't notice any change in brightness of display.
a) Am I doing something wrong?
b) Were there any changes in iOS regarding this?
setWantsSoftwareDimming: won't on itself do anything to the screen. It will instead change the scale that the brightness property of UIScreen uses. You should be calling it before you call setBrightness:. Perhaps if you post the method in which you set the brightness / call setWantsSoftwareDimming you might get some more useful feedback?