Questions tagged [uiscreen]

A UIScreen object contains the bounding rectangle of the device’s entire screen. When setting up your application’s user interface, you should use the properties of this object to get the recommended frame rectangles for your application’s window.

153 questions
1
vote
1 answer

How to detect the color of an UIImage in iOS

I have a view like this : The left back button & the right button is basically two white image (set in UIButton) with a particular opacity. Now it's look more or less visible on this background cover photo. But if I change the background cover…
Tulon
  • 4,011
  • 6
  • 36
  • 56
1
vote
2 answers

Why is float multiplication showing 0

float yLimit = [[UIScreen mainScreen] bounds].size.height; yLimit = yLimit * (2/3); NSLog(@"ylimit: %f", yLimit); the nslog yields 0.0. Huh?
quantumpotato
  • 9,637
  • 14
  • 70
  • 146
1
vote
1 answer

When I connect iPhone 6 and check with my code, He think i connect iPhone 5

I have a problem identifying the types of devices. When I connect iPhone 4 the print is " is iPhone 4" When I connect iPhone 5 or 5 s the print is " is iPhone 5" When I connect iPhone 6 plus the print is " is iPhone 6 plus" And the problem is : When…
Roei Nadam
  • 1,780
  • 1
  • 15
  • 33
1
vote
3 answers

IS_IPHONE_5 returns 0 even if it is running on iPhone5C

I have used this code to detect if the device is iPhone 5 or not to set appropriate UI. ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )568 ) < DBL_EPSILON ) However, it returns a 0 even if the app is running in iPhone…
ScarletWitch
  • 522
  • 6
  • 23
1
vote
1 answer

Unable to detect iPhone Retina 4-inch screen size in simulator

I want to make my iOS application support iPhone 5. So I created a separate xib set for iPhone 5 size. Then I load each xib by checking the screen height. This is the splash screen loading code inside the AppDelegate.m: -…
iDia
  • 1,397
  • 8
  • 25
  • 44
1
vote
1 answer

Black second screen on the iOS iPad simulator in landscape mode

I'm trying to get an external screen for an iOS iPad app up and running. Currently I just could test this with the iOS simulator (VGA connection kit is on it's way). My problem is that when starting the app in landscape (left or right) or portrait…
Funkybit
  • 359
  • 1
  • 2
  • 15
1
vote
0 answers

Is it possible to only output the Detail View Controller view through HMDI/TV out when using a Split View Controller?

Is it possible to setup a UISplitViewController to only output the DetailViewController view to the HDMI/TV out? Here is what I have attempted so far without success: if([[UIScreen screens]count] > 1){ CGSize max; UIScreenMode…
1
vote
3 answers

UIScreen mainScreen bounds.size.height always 1024

Why would [UIScreen mainScreen].bounds.size.height always return 1024 no matter what layout mode the iPad app is in? I am trying to have a custom view dynamically generated based on layout mode and I always get a height of 1024 back? +…
jdog
  • 10,351
  • 29
  • 90
  • 165
1
vote
1 answer

iOS - UIScreen setBrightness doesn't work

Simply doing this: [[UIScreen mainScreen] setBrightness:0.2]; Doesn't work. Has no effect at all on the app. Is there some other setting I need to set for this to work?
soleil
  • 12,133
  • 33
  • 112
  • 183
1
vote
2 answers

How to choose the display mode of UIScreen to cover the whole tv screen?

I am writing a player to output video to TV from iOS device connected with HDMI. I found the preferred screen mode and any other screen modes of the UIScreen might not be able to cover the tv screen. It behaves different with various models of…
Slavik
  • 1,053
  • 1
  • 13
  • 26
1
vote
0 answers

iOS screen dim bug solutions

Some days ago i asked this question: Prevent iPhone to sleep Then i found out the bug that can't let the delegate methods change the screen bright back to normal when the home button is pressed. I looked around and saw some "solutions" involving…
douglasd3
  • 761
  • 2
  • 10
  • 27
0
votes
1 answer

Determine UIScreen half in SwiftUI

I have a gesture applied to my text. Right now, it is sitting at the bottom of the screen and if I drag it to anywhere and let go, it goes back to the bottom. But if I drag it to the top half of my device screen, it should stay at the top. The…
0
votes
1 answer

Can't set UIScreen.main.brightness = 1.0

I setting UIScreen.main.brightness = 1.0 at viewDidLoad. But print in console value of UIScreen.main.brightness is 0.9483038187026978. Please help me. I not good English , so sorry
quyle1222
  • 11
  • 1
0
votes
1 answer

Why do UIScreen dimensions differ on iOS device and simulator?

In troubleshooting an app I'm developing, I discovered that the UIScreen.main.bounds.width differs between my iPhone 8 Plus real device vs the simulator. To narrow it down, I created a new Swift app from the iOS App template in Xcode 13.4.1…
grosssw
  • 11
  • 4
0
votes
0 answers

UIScreen.main.bounds.size.width gives me reversed values

I need to have the correct width when rotating the device. I check the value and it works fine to update the value when rotating, except it gives me the width of the device reversed. So when I turn landscape, it gives me the width of the device in…
ldo1985
  • 115
  • 6