@@ -70,6 +70,7 @@ - (CDV_iOSDevice) getCurrentDevice
70
70
// this is appropriate for detecting the runtime screen environment
71
71
device.iPhone6 = (device.iPhone && limit == 667.0 );
72
72
device.iPhone6Plus = (device.iPhone && limit == 736.0 );
73
+ device.iPhoneX = (device.iPhone && limit == 812.0 );
73
74
74
75
return device;
75
76
}
@@ -100,8 +101,12 @@ - (NSString*)getImageName:(UIInterfaceOrientation)currentOrientation delegate:(i
100
101
imageName = [imageName stringByAppendingString: @" -700" ];
101
102
} else if (device.iPhone6 ) {
102
103
imageName = [imageName stringByAppendingString: @" -800" ];
103
- } else if (device.iPhone6Plus ) {
104
- imageName = [imageName stringByAppendingString: @" -800" ];
104
+ } else if (device.iPhone6Plus || device.iPhoneX ) {
105
+ if (device.iPhone6Plus ) {
106
+ imageName = [imageName stringByAppendingString: @" -800" ];
107
+ } else {
108
+ imageName = [imageName stringByAppendingString: @" -1100" ];
109
+ }
105
110
if (currentOrientation == UIInterfaceOrientationPortrait || currentOrientation == UIInterfaceOrientationPortraitUpsideDown) {
106
111
imageName = [imageName stringByAppendingString: @" -Portrait" ];
107
112
}
@@ -115,7 +120,7 @@ - (NSString*)getImageName:(UIInterfaceOrientation)currentOrientation delegate:(i
115
120
imageName = isLandscape ? nil : [imageName stringByAppendingString: @" -568h" ];
116
121
} else if (device.iPhone6 ) { // does not support landscape
117
122
imageName = isLandscape ? nil : [imageName stringByAppendingString: @" -667h" ];
118
- } else if (device.iPhone6Plus ) { // supports landscape
123
+ } else if (device.iPhone6Plus || device. iPhoneX ) { // supports landscape
119
124
if (isOrientationLocked) {
120
125
imageName = [imageName stringByAppendingString: (supportsLandscape ? @" -Landscape" : @" " )];
121
126
} else {
@@ -128,7 +133,11 @@ - (NSString*)getImageName:(UIInterfaceOrientation)currentOrientation delegate:(i
128
133
break ;
129
134
}
130
135
}
131
- imageName = [imageName stringByAppendingString: @" -736h" ];
136
+ if (device.iPhoneX ) {
137
+ imageName = [imageName stringByAppendingString: @" -2436h" ];
138
+ } else {
139
+ imageName = [imageName stringByAppendingString: @" -736h" ];
140
+ }
132
141
133
142
} else if (device.iPad ) { // supports landscape
134
143
if (isOrientationLocked) {
0 commit comments