草庐IT

五方面

全部标签

在 Swift 中使用方面 Fit 时将背景设置为覆盖整个屏幕

SettingbackgroundtocoverwholescreenwhenusingaspectFitinSwift当在swift中使用aspectfit时,屏幕的两侧会被移除。有没有办法通过使用背景颜色填充整个屏幕或使用背景图像来掩盖这一点?这是在GameViewController中创建场景的代码123456789101112131415161718ifletview=self.viewas!SKView?{      ifletscene=SKScene(fileNamed:"mainMenu"){//        settingsceneheretoaspectfit      

在 Swift 中使用方面 Fit 时将背景设置为覆盖整个屏幕

SettingbackgroundtocoverwholescreenwhenusingaspectFitinSwift当在swift中使用aspectfit时,屏幕的两侧会被移除。有没有办法通过使用背景颜色填充整个屏幕或使用背景图像来掩盖这一点?这是在GameViewController中创建场景的代码123456789101112131415161718ifletview=self.viewas!SKView?{      ifletscene=SKScene(fileNamed:"mainMenu"){//        settingsceneheretoaspectfit