简体   繁体   English

iOS模拟器不会将图层渲染为真实设备

[英]iOS Simulators doesnt render layer as real device

On my iOS app I use a Google Maps view with a GMSLayer, the transparency renders correctly on a real device but the background is white on Simulator, I can't make the screenshots for the App Store... 在我的iOS应用程序上,我将Google Maps视图与GMSLayer一起使用,透明度在真实设备上正确呈现,但模拟器上的背景为白色,我无法为App Store制作屏幕截图...

在模拟器上(iPhone XR) 在真实设备上

And this is the code I use : 这是我使用的代码:

// Implement GMSTileURLConstructor
    // Returns a Tile based on the x,y,zoom coordinates, and the requested floor

    let urls: GMSTileURLConstructor = {(x, y, zoom) in
        let url = "http://wxs.ign.fr/[KEY]/geoportail/wmts?LAYER=TRANSPORTS.DRONES.RESTRICTIONS&FORMAT=image/png&SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&STYLE=normal&TILEMATRIXSET=PM&TILEMATRIX=" + String(zoom) + "&TILEROW="+String(y)+"&TILECOL="+String(x)
        return URL(string: url)
    }

    // Create the GMSTileLayer

    let layer = GMSURLTileLayer(urlConstructor: urls)

    layer.zIndex = 0
    layer.map = mapView

class TestTileLayer: GMSSyncTileLayer {
override func tileFor(x: UInt, y: UInt, zoom: UInt) -> UIImage {

    let url = URL(string : "http://wxs.ign.fr/[KEY]/geoportail/wmts?LAYER=TRANSPORTS.DRONES.RESTRICTIONS&FORMAT=image/png&SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&STYLE=normal&TILEMATRIXSET=PM&TILEMATRIX=" + String(zoom) + "&TILEROW="+String(y)+"&TILECOL="+String(x))

    return UIImage(data: try! Data(contentsOf: url!))!
}
}

I'm sure the image given by the URL uses transparency and I tried to manually change the white pixel to transparent but it doesn't change anything... 我确定URL给定的图像使用了透明性,并且我尝试将白色像素手动更改为透明性,但是它没有任何改变...

This is a simulator problem only it has been mentioned here . 这是一个模拟器问题,仅在此处已提及。

However as @a.munzer suggested some work around you can take a screenshot from a real device and just edit it, shouldn't be that much of a problem. 但是,正如@ a.munzer建议的那样,您可以采取一些措施来从真实设备中截取屏幕截图并进行编辑,这不应该是什么大问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 iOS模拟器中是否有相机设备模拟? - Is there Camera Device Simulation in iOS Simulators? 声音不在iOS设备上播放,但在iOS模拟器中工作 - Sound not playing on iOS device but working in iOS simulators React Native 构建可以在模拟器中运行,但不能在 ios 设备上运行? - React Native builds work in simulators but not on ios device? 在真实设备(“ iphone”)上登录失败,但在ipad ans模拟器上有效 - Login fails on real device(“iphone”) but works on ipad ans simulators Base SDK 6.1不会在Xcode 6.0.1中显示iOS 8模拟器 - Base SDK 6.1 doesnt show iOS 8 simulators in Xcode 6.0.1 iOS链接到专为真实设备而非模拟器设计的库时出错 - iOS Get errors in linking libraries that are designed for real devices not simulators 可以在没有实际设备或模拟器的情况下运行iOS UI自动化吗? - Can iOS UI Automation be ran without real devices or simulators? 在真实设备上测试iOS - Test iOS on real device iOS app blank navigationView 在某些设备模拟器上打开屏幕而不是其他 - iOS app blank navigationView opening screen on some device simulators and not others 可以使用两个iOS模拟器在Mac上没有设备的情况下对multipeer进行测试吗? - Can multipeer be tested with two iOS simulators and no device on mac?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM