I am developing one application for iPad and iPhone, I want to make a slider control to change the brightness of the screen as per the slider value. Can any one help me to solve my problem
Thanks in advance...
You can't do this with public APIs. You could put an overlay to make the screen darker, but you can't adjust the hardware brightness.
Related
Is there a way to change frame of UILabel if the iPhone in Zoomed mode because the application is okay with standard mode but zoomed mode the UILabel inside tableView doesn't show whole text.
See iPhone6 Display Zoom Functionality disturbs the whole view for some ideas, but I wish there was a more comprehensive guide, e.g., from Apple, on how we can make our apps support "display zoom" properly. Any pointers to something like that? Anyone?
So I have an app and I want a very different layout based on size class. And I thought I'd accomplished this today because the storyboard preview showed every device and every size in every orientation doing exactly what it was supposed to do. When I ran this on my device and then the simulator however, the size class seemed not to change as the layout was pretty much the same thing as before. Here is screenshot showing my issue. Please note that the psycho spray painting was done by me not Xcode:
So I was hoping someone could help. In case you're wondering, I did the psycho spray painting to protect some confidential info which I thought was pretty obvious but there you go :)
Thanks for reading and thanks in advance for the help!
EDIT:
Here is a screenshot of all constraints for the two main size classes. The green and blue objects that are blanked out do correspond. So the blue thing up top is the blue thing in the constraints. The green is label and slider of the same part of the app's functionality which I don't want to reveal. For now all I'll say is that it's a music app as you can tell by looking at the photos below.
Okay I found the problem! I forgot to resolve some issues in my Compact width and compact height (aka 3.5,4,and 4.7 inch iPhones in landscape) which forced it to use the previous size class's layout.
I'm coding a remote control with a background (designed in Photoshop) already for the iPhone 6+ with the proper resolution, which I use with an UIImageView at full size.
I disabled Autolayout/Size Classes and set the size to Inferred. Further I uploaded all relevant LaunchImages for proper scaling.
The UIImageView scales properly for all screen sizes, but the buttons I put over the background are moving.
For example:
All buttons (over 1-9, Power Off, Menu ecc.) should always stay at the same position (in releation to the selected device and screen resolution).
I can't get it, that all buttons stay over the designed photoshop elements.
Please give me a good advice, to solve this issue.
I would recommend using size classes and Autolayout. This type of thing is exactly what they are made for.
This youtube video is a great introduction to size classes and some Autolayout:
https://www.youtube.com/watch?v=IwSTXY0awng&feature=youtu.be
I have been trying to solve this app icon color issue all morning. I am still experiencing this after going through both of these highly recommended photoshop/iOS design articles:
http://davidmckinney.com/blog/2013/12/31/designing-iphone-apps-how-to-setup-photoshop
http://bjango.com/articles/photoshop/
Here is the problem that I am having:
When creating my app's icon, the color that I see in Photoshop is the exact same color that I see in xcode's asset catalog. It is also perfect when I run the app on the iOS simulator.
However, when I run my app on my iPhone the app icon's color is always darker.
What's weird, is if I take a screenshot of my iPhone's screen and email it to myself, the color is correct! So for some reason the color is only darker when you are actually looking at the iPhone's screen.
Pardon my ignorance, but this is the first design I have ever done for an iOS app and I don't understand why this is happening or how to fix it.
EDIT: I am now using LiveView after reading this answer: https://stackoverflow.com/a/3597221/3344977
What's funny is no matter how hard I try I cannot get the color I see on my screen to appear on my iPhone screen. It's as if this shade of Pink I'm trying to use just isn't possible to render on an iPhone display.
This is because your iPhone and Monitor screens have different color calibrations (if that's the right term)
You're going to want to setup a color profile on your computer that matches the iPhone screens as closely as possible, and use that when developing icons.
for some reason the color is only darker when you are actually looking at the iPhone's screen
Consider turning up the brightness on your iPhone. Go to Settings->Wallpapers & Brightness to adjust it.
In any case, the issue isn't that the value of the color is changing on your device, it's just that that color value is being rendered differently.
Its because the resolution of your screen is different than your iOS device try it on other device
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?