iPhone XR returns correct nativeBounds but has wrong screen size on device
up vote
0
down vote
favorite
My project target iOS - 11 and later. It has correct Launch images assets for XR and XS Max with appropriate dimensions. On simulator my app works as expected on both XR and XS Max.
But, users reported UI issues on real devices. After some research it looks like on real device this
[UIScreen mainScreen].nativeBounds.size
returns correct values. But seems like device itself think that it has iPhone X screen size (like when i do not use correct launch screen images). And in my opinion it returns wrong values with
[UIScreen mainScreen].bounds.size
this one i believe returns values like it's not iPhone XR but iPhone X.
Did someone face such an issue too?
ios objective-c iphone ios12
add a comment |
up vote
0
down vote
favorite
My project target iOS - 11 and later. It has correct Launch images assets for XR and XS Max with appropriate dimensions. On simulator my app works as expected on both XR and XS Max.
But, users reported UI issues on real devices. After some research it looks like on real device this
[UIScreen mainScreen].nativeBounds.size
returns correct values. But seems like device itself think that it has iPhone X screen size (like when i do not use correct launch screen images). And in my opinion it returns wrong values with
[UIScreen mainScreen].bounds.size
this one i believe returns values like it's not iPhone XR but iPhone X.
Did someone face such an issue too?
ios objective-c iphone ios12
You better add some code. Then we might understand what you mean by wrong bounds and real wrong bounds and nativeBounds.
– Codo
Nov 12 at 17:28
Fixed question a bit. I believe it should be easier to understand now.
– Vlad Polyanskiy
Nov 12 at 18:15
1
You talk about correct and wrong values. You better specify what values you expect and what values you get. Otherwise the question is still too vague.
– Codo
Nov 12 at 19:44
And by the way: to what value have you set the Base SDK in your project?
– Codo
Nov 12 at 19:45
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
My project target iOS - 11 and later. It has correct Launch images assets for XR and XS Max with appropriate dimensions. On simulator my app works as expected on both XR and XS Max.
But, users reported UI issues on real devices. After some research it looks like on real device this
[UIScreen mainScreen].nativeBounds.size
returns correct values. But seems like device itself think that it has iPhone X screen size (like when i do not use correct launch screen images). And in my opinion it returns wrong values with
[UIScreen mainScreen].bounds.size
this one i believe returns values like it's not iPhone XR but iPhone X.
Did someone face such an issue too?
ios objective-c iphone ios12
My project target iOS - 11 and later. It has correct Launch images assets for XR and XS Max with appropriate dimensions. On simulator my app works as expected on both XR and XS Max.
But, users reported UI issues on real devices. After some research it looks like on real device this
[UIScreen mainScreen].nativeBounds.size
returns correct values. But seems like device itself think that it has iPhone X screen size (like when i do not use correct launch screen images). And in my opinion it returns wrong values with
[UIScreen mainScreen].bounds.size
this one i believe returns values like it's not iPhone XR but iPhone X.
Did someone face such an issue too?
ios objective-c iphone ios12
ios objective-c iphone ios12
edited Nov 12 at 18:14
asked Nov 12 at 14:53
Vlad Polyanskiy
1,38911221
1,38911221
You better add some code. Then we might understand what you mean by wrong bounds and real wrong bounds and nativeBounds.
– Codo
Nov 12 at 17:28
Fixed question a bit. I believe it should be easier to understand now.
– Vlad Polyanskiy
Nov 12 at 18:15
1
You talk about correct and wrong values. You better specify what values you expect and what values you get. Otherwise the question is still too vague.
– Codo
Nov 12 at 19:44
And by the way: to what value have you set the Base SDK in your project?
– Codo
Nov 12 at 19:45
add a comment |
You better add some code. Then we might understand what you mean by wrong bounds and real wrong bounds and nativeBounds.
– Codo
Nov 12 at 17:28
Fixed question a bit. I believe it should be easier to understand now.
– Vlad Polyanskiy
Nov 12 at 18:15
1
You talk about correct and wrong values. You better specify what values you expect and what values you get. Otherwise the question is still too vague.
– Codo
Nov 12 at 19:44
And by the way: to what value have you set the Base SDK in your project?
– Codo
Nov 12 at 19:45
You better add some code. Then we might understand what you mean by wrong bounds and real wrong bounds and nativeBounds.
– Codo
Nov 12 at 17:28
You better add some code. Then we might understand what you mean by wrong bounds and real wrong bounds and nativeBounds.
– Codo
Nov 12 at 17:28
Fixed question a bit. I believe it should be easier to understand now.
– Vlad Polyanskiy
Nov 12 at 18:15
Fixed question a bit. I believe it should be easier to understand now.
– Vlad Polyanskiy
Nov 12 at 18:15
1
1
You talk about correct and wrong values. You better specify what values you expect and what values you get. Otherwise the question is still too vague.
– Codo
Nov 12 at 19:44
You talk about correct and wrong values. You better specify what values you expect and what values you get. Otherwise the question is still too vague.
– Codo
Nov 12 at 19:44
And by the way: to what value have you set the Base SDK in your project?
– Codo
Nov 12 at 19:45
And by the way: to what value have you set the Base SDK in your project?
– Codo
Nov 12 at 19:45
add a comment |
3 Answers
3
active
oldest
votes
up vote
0
down vote
I faced the same question, and I found the reason. You could check the LaunchImage in the assets. Is there an image for the iPhone XR. If you don't have the iPhone XR LaunchImage, the screen size of XR will compute with the the iPhone X. So make a LaunchImage for XR.
Hope this helps.
Please read question carefully. It has correct launch images.
– Vlad Polyanskiy
2 days ago
add a comment |
up vote
0
down vote
The iPhone XR does not use the same size in (virtual) points than the iPhone X or iPhone XS does. It uses the same point dimensions like the new iPhone XS Max, but is rendered only with @2x
instead of @3x
, like the Max does (lower pixel per inch density). You can read more about screen sizes, points, rendered dimensions etc. for each iPhone model here.
The missing templates for launch images in XCAssets also affect the new generation of iPads, as e.g. the new iPad Pro 11" slightly differs from the standard 3/4 aspect ratio, the other iPads have. Diving deeper into the missing templates issue brought me to this radar post from 2015 about missing iPad Pro App Icon and Launch Image templates, where the comment states:
[...] and Developer relations reported in a radar comment that they no longer support launch images and will not be adding the iPad pro launch image size to asset catalogs.
It seems like Apple is discouraging the use of launch images inside XCAssets and proposes to use Launch Screen.storyboard
instead. It will "auto-size" to the correct dimensions (and respectively the outputs of UIScreen.main.bounds
and UIScreen.main.nativeBounds
) depending on the used device or simulator.
Interesting info, thanks. But in my case the trouble was in a specific user device settings. See my answer below.
– Vlad Polyanskiy
2 days ago
add a comment |
up vote
0
down vote
In my case the trouble was in the specific user device settings.
Settings -> Display & brightness -> Display zoom switch to ON.
This cause to return wrong
[UIScreen mainScreen].bounds.size
values runtime
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
I faced the same question, and I found the reason. You could check the LaunchImage in the assets. Is there an image for the iPhone XR. If you don't have the iPhone XR LaunchImage, the screen size of XR will compute with the the iPhone X. So make a LaunchImage for XR.
Hope this helps.
Please read question carefully. It has correct launch images.
– Vlad Polyanskiy
2 days ago
add a comment |
up vote
0
down vote
I faced the same question, and I found the reason. You could check the LaunchImage in the assets. Is there an image for the iPhone XR. If you don't have the iPhone XR LaunchImage, the screen size of XR will compute with the the iPhone X. So make a LaunchImage for XR.
Hope this helps.
Please read question carefully. It has correct launch images.
– Vlad Polyanskiy
2 days ago
add a comment |
up vote
0
down vote
up vote
0
down vote
I faced the same question, and I found the reason. You could check the LaunchImage in the assets. Is there an image for the iPhone XR. If you don't have the iPhone XR LaunchImage, the screen size of XR will compute with the the iPhone X. So make a LaunchImage for XR.
Hope this helps.
I faced the same question, and I found the reason. You could check the LaunchImage in the assets. Is there an image for the iPhone XR. If you don't have the iPhone XR LaunchImage, the screen size of XR will compute with the the iPhone X. So make a LaunchImage for XR.
Hope this helps.
answered Nov 19 at 8:33
iNerv
1
1
Please read question carefully. It has correct launch images.
– Vlad Polyanskiy
2 days ago
add a comment |
Please read question carefully. It has correct launch images.
– Vlad Polyanskiy
2 days ago
Please read question carefully. It has correct launch images.
– Vlad Polyanskiy
2 days ago
Please read question carefully. It has correct launch images.
– Vlad Polyanskiy
2 days ago
add a comment |
up vote
0
down vote
The iPhone XR does not use the same size in (virtual) points than the iPhone X or iPhone XS does. It uses the same point dimensions like the new iPhone XS Max, but is rendered only with @2x
instead of @3x
, like the Max does (lower pixel per inch density). You can read more about screen sizes, points, rendered dimensions etc. for each iPhone model here.
The missing templates for launch images in XCAssets also affect the new generation of iPads, as e.g. the new iPad Pro 11" slightly differs from the standard 3/4 aspect ratio, the other iPads have. Diving deeper into the missing templates issue brought me to this radar post from 2015 about missing iPad Pro App Icon and Launch Image templates, where the comment states:
[...] and Developer relations reported in a radar comment that they no longer support launch images and will not be adding the iPad pro launch image size to asset catalogs.
It seems like Apple is discouraging the use of launch images inside XCAssets and proposes to use Launch Screen.storyboard
instead. It will "auto-size" to the correct dimensions (and respectively the outputs of UIScreen.main.bounds
and UIScreen.main.nativeBounds
) depending on the used device or simulator.
Interesting info, thanks. But in my case the trouble was in a specific user device settings. See my answer below.
– Vlad Polyanskiy
2 days ago
add a comment |
up vote
0
down vote
The iPhone XR does not use the same size in (virtual) points than the iPhone X or iPhone XS does. It uses the same point dimensions like the new iPhone XS Max, but is rendered only with @2x
instead of @3x
, like the Max does (lower pixel per inch density). You can read more about screen sizes, points, rendered dimensions etc. for each iPhone model here.
The missing templates for launch images in XCAssets also affect the new generation of iPads, as e.g. the new iPad Pro 11" slightly differs from the standard 3/4 aspect ratio, the other iPads have. Diving deeper into the missing templates issue brought me to this radar post from 2015 about missing iPad Pro App Icon and Launch Image templates, where the comment states:
[...] and Developer relations reported in a radar comment that they no longer support launch images and will not be adding the iPad pro launch image size to asset catalogs.
It seems like Apple is discouraging the use of launch images inside XCAssets and proposes to use Launch Screen.storyboard
instead. It will "auto-size" to the correct dimensions (and respectively the outputs of UIScreen.main.bounds
and UIScreen.main.nativeBounds
) depending on the used device or simulator.
Interesting info, thanks. But in my case the trouble was in a specific user device settings. See my answer below.
– Vlad Polyanskiy
2 days ago
add a comment |
up vote
0
down vote
up vote
0
down vote
The iPhone XR does not use the same size in (virtual) points than the iPhone X or iPhone XS does. It uses the same point dimensions like the new iPhone XS Max, but is rendered only with @2x
instead of @3x
, like the Max does (lower pixel per inch density). You can read more about screen sizes, points, rendered dimensions etc. for each iPhone model here.
The missing templates for launch images in XCAssets also affect the new generation of iPads, as e.g. the new iPad Pro 11" slightly differs from the standard 3/4 aspect ratio, the other iPads have. Diving deeper into the missing templates issue brought me to this radar post from 2015 about missing iPad Pro App Icon and Launch Image templates, where the comment states:
[...] and Developer relations reported in a radar comment that they no longer support launch images and will not be adding the iPad pro launch image size to asset catalogs.
It seems like Apple is discouraging the use of launch images inside XCAssets and proposes to use Launch Screen.storyboard
instead. It will "auto-size" to the correct dimensions (and respectively the outputs of UIScreen.main.bounds
and UIScreen.main.nativeBounds
) depending on the used device or simulator.
The iPhone XR does not use the same size in (virtual) points than the iPhone X or iPhone XS does. It uses the same point dimensions like the new iPhone XS Max, but is rendered only with @2x
instead of @3x
, like the Max does (lower pixel per inch density). You can read more about screen sizes, points, rendered dimensions etc. for each iPhone model here.
The missing templates for launch images in XCAssets also affect the new generation of iPads, as e.g. the new iPad Pro 11" slightly differs from the standard 3/4 aspect ratio, the other iPads have. Diving deeper into the missing templates issue brought me to this radar post from 2015 about missing iPad Pro App Icon and Launch Image templates, where the comment states:
[...] and Developer relations reported in a radar comment that they no longer support launch images and will not be adding the iPad pro launch image size to asset catalogs.
It seems like Apple is discouraging the use of launch images inside XCAssets and proposes to use Launch Screen.storyboard
instead. It will "auto-size" to the correct dimensions (and respectively the outputs of UIScreen.main.bounds
and UIScreen.main.nativeBounds
) depending on the used device or simulator.
answered Nov 19 at 9:12
Rainer Schwarz
113
113
Interesting info, thanks. But in my case the trouble was in a specific user device settings. See my answer below.
– Vlad Polyanskiy
2 days ago
add a comment |
Interesting info, thanks. But in my case the trouble was in a specific user device settings. See my answer below.
– Vlad Polyanskiy
2 days ago
Interesting info, thanks. But in my case the trouble was in a specific user device settings. See my answer below.
– Vlad Polyanskiy
2 days ago
Interesting info, thanks. But in my case the trouble was in a specific user device settings. See my answer below.
– Vlad Polyanskiy
2 days ago
add a comment |
up vote
0
down vote
In my case the trouble was in the specific user device settings.
Settings -> Display & brightness -> Display zoom switch to ON.
This cause to return wrong
[UIScreen mainScreen].bounds.size
values runtime
add a comment |
up vote
0
down vote
In my case the trouble was in the specific user device settings.
Settings -> Display & brightness -> Display zoom switch to ON.
This cause to return wrong
[UIScreen mainScreen].bounds.size
values runtime
add a comment |
up vote
0
down vote
up vote
0
down vote
In my case the trouble was in the specific user device settings.
Settings -> Display & brightness -> Display zoom switch to ON.
This cause to return wrong
[UIScreen mainScreen].bounds.size
values runtime
In my case the trouble was in the specific user device settings.
Settings -> Display & brightness -> Display zoom switch to ON.
This cause to return wrong
[UIScreen mainScreen].bounds.size
values runtime
answered 2 days ago
Vlad Polyanskiy
1,38911221
1,38911221
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53264692%2fiphone-xr-returns-correct-nativebounds-but-has-wrong-screen-size-on-device%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You better add some code. Then we might understand what you mean by wrong bounds and real wrong bounds and nativeBounds.
– Codo
Nov 12 at 17:28
Fixed question a bit. I believe it should be easier to understand now.
– Vlad Polyanskiy
Nov 12 at 18:15
1
You talk about correct and wrong values. You better specify what values you expect and what values you get. Otherwise the question is still too vague.
– Codo
Nov 12 at 19:44
And by the way: to what value have you set the Base SDK in your project?
– Codo
Nov 12 at 19:45