我正在尝试使用 SceneKit 进行练习并制作 IOS 游戏。在 Xcode 12 Beta 5 中,但无论我做什么,SceneView 都不会填满屏幕,这是使用 SceneKit 启动游戏时的默认代码。当我使用 Xcode 11 时,它会填满屏幕,但我无法在 Xcode 11 中打开 sin 文件。
我试图在导航链接内部的视图上显示工具栏。当我导航到第三个视图时,我收到以下消息:
2020-09-15 23:09:31.097289-0500 CountTime[35018:3542166] [Assert] displayModeButtonItem 是内部管理的,不会公开为 DoubleColumn 样式。返回一个空的、断开连接的 UIBarButtonItem 来履行非空契约。
并且工具栏未显示。这种情况仅发生在 iPhone 上,而不是 iPad 上。我正在使用 Xcode 12 GM。
这是代码:
struct ContentView: View {
var body: some View {
NavigationView {
NavigationLink(
destination: SecondView(),
label: {
Text("Navigate")
})
}
}
}
struct SecondView: View {
var body: some View {
ZStack {
NavigationLink(
destination: Text("Destination")
.toolbar {
ToolbarItem(placement: ToolbarItemPlacement.bottomBar) {
Button(action: {
print("sharing")
}) {
Image(systemName: "square.and.arrow.up")
}
}
},
label: {
Text("Navigate")
})
}
}
}
Run Code Online (Sandbox Code Playgroud) 我试图通过在 Info.plist 文件中将 UIUserInterfaceStyle 键设置为 Light 来禁用暗模式支持,但现在它在 Xcode 12 的 Info.plist 中不可用。
是否仍然可以从 Info.plist 文件为 Xcode 12 中的 iOS 应用程序禁用暗模式支持。
从 Xcode 构建我的 React Native 项目会出现以下错误;
Multiple commands produce '/Users/USERNAME/Library/Developer/Xcode/DerivedData/PROJECT-grjkuplqgvolxebnwadcuuhwkdak/Build/Intermediates.noindex/ArchiveIntermediates/PROJECT/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle':
1) Target 'React-Core.common-AccessibilityResources' has create directory command with output '/Users/USERNAME/Library/Developer/Xcode/DerivedData/PROJECT-grjkuplqgvolxebnwadcuuhwkdak/Build/Intermediates.noindex/ArchiveIntermediates/PROJECT/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle'
2) Target 'React-Core.common-CoreModulesHeaders-AccessibilityResources' has create directory command with output '/Users/USERNAME/Library/Developer/Xcode/DerivedData/PROJECT-grjkuplqgvolxebnwadcuuhwkdak/Build/Intermediates.noindex/ArchiveIntermediates/PROJECT/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle'
Run Code Online (Sandbox Code Playgroud)
我检查了“多个命令产生”错误的其他答案,但到目前为止还没有运气。不过,它们主要与矢量图标有关。
如何修复 AccessibilityResources 的此错误?
我从 Vapor 3 更新到 4,从 Xcode 11 更新到 12。现在 Leaf 找不到我的 *.leaf 模板。我收到“noTemplateFile”错误。
在物理设备(运行 14.0.1 的设备)上使用 Xcode 12 运行任何应用程序时出现问题
从一个新项目开始,简单的 Hello World 应用程序在连接到 Xcode 时不会在我的设备上启动。
屏幕保持黑色,显示白色底部主页栏。Xcode 显示应用程序正在运行,没有警告,没有错误。
struct ContentView: View {
var body: some View {
Text("Hello, world!").foregroundColor(.red)
.padding()
.onAppear {
print("Working....")
}
}
}
Run Code Online (Sandbox Code Playgroud)
它在模拟器上运行良好,因此打印出调试文本。
但是,在我的设备上,我没有收到调试文本 - 所以启动过程失败了。
但是,如果我在 Xcode 上停止该项目,然后在我的设备上运行已安装的应用程序,该应用程序将按预期运行!!
我更改了几次字体颜色,它正确地将应用程序安装到设备上,但在连接到 Xcode 时无法运行,但在手机上运行应用程序时可以正常工作
我取消了我的设备的配对,但没有帮助。
不知道接下来要尝试什么...
感谢您的任何建议
我已切换到Xcode12我的静态库应用程序之一。我正在尝试制作 XCFramework 发行版。运行构建命令后,
xcodebuild archive -scheme "MySDK" -sdk iphoneos -archivePath \xe2\x80\x9c./archives/ios.xcarchive\xe2\x80\x9d -SKIP_INSTALL=NO\nRun Code Online (Sandbox Code Playgroud)\nBuild Settings -> Build Libraries for Distribution当我切换到时出现以下错误YES,
<unknown>:0: error: using bridging headers with module interfaces is unsupported\nCommand CompileSwiftSources failed with a nonzero exit code\n\n** ARCHIVE FAILED **\n\n\nThe following build commands failed:\n CompileSwiftSources normal armv7 com.apple.xcode.tools.swift.compiler\n CompileSwiftSources normal armv7s com.apple.xcode.tools.swift.compiler\n CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler\n(3 failures)\nRun Code Online (Sandbox Code Playgroud)\n这个答案有效,但不幸的是创建.xcframework需要设置选项 distribution YES。
如何解决这个问题?
\n我试图弄清楚如何改变不同的值View。这是我的主要视图的实现:
import SwiftUI
import Combine
struct ContentView: View {
@State private var isPresented: Bool = false
@State private var textToProces = "" {
didSet{
print("text: oldValue=\(oldValue) newValue=\(textToProces)")
}
}
var body: some View {
ZStack{
VStack{
Button("Show Alert"){
self.isPresented = true
}.background(Color.blue)
}
ItemsAlertView(isShown: $isPresented, textToProcess: $textToProces)
}
}
}
Run Code Online (Sandbox Code Playgroud)
在这个视图中,我试图更改textToProces变量:
struct AnotherView: View {
@Binding var isShown: Bool
@Binding var textToProcess: String
var title: String = "Add Item"
let screenSize = UIScreen.main.bounds
var body: some …Run Code Online (Sandbox Code Playgroud) 我们已经尝试了 iOS 14 和 13。在这两种情况下,故事板屏幕都是这样显示的。
有没有其他人遇到过这个问题并且能够解决它?或者我们应该恢复到 xcode 11 或 10 来解决这个问题?
在编写我的第一个 iOS 应用程序的过程中,我遇到了一个新问题,到目前为止我无法找到解决方案:我想使用环境对象将信息传递到各种视图。
我知道对此有很多解释和教程(例如,在 hackingwithswift.com 上:https://www.hackingwithswift.com/quick-start/swiftui/how-to-use-environmentobject-to-share-data- Between-意见
然而,所有这些教程似乎都在使用“场景委托”,根据我目前的理解,Xcode 12 中不存在这种委托。
因此,我正在努力解决如何/在哪里放置环境对象在我的应用程序环境中以及如何将其连接到我的内容视图/其他视图。
这段代码应该放在哪里?它会进入内容视图吗?
class UserSettings: ObservableObject {
@Published var score = 0
}
Run Code Online (Sandbox Code Playgroud)
有人能帮忙解决这个问题吗?我会很感激 :)
xcode12 ×10
ios ×6
swift ×3
swiftui ×3
xcode ×3
ios14 ×2
device ×1
ios-darkmode ×1
launch ×1
leaf ×1
react-native ×1
storyboard ×1
swift5 ×1
vapor ×1
xcframework ×1
xcode12beta5 ×1
xcodebuild ×1