我试图在画布中预览以下预览,但修改器previewLayout(.sizeThatFits)不起作用。
我尝试使用画布底部的“实时”“和可选”按钮,但它仍然不起作用。
import SwiftUI
struct Custom_Picker: View {
var body: some View {
Text("Hello, World!")
}
}
#Preview(traits: .sizeThatFitsLayout) {
Custom_Picker()
}
Run Code Online (Sandbox Code Playgroud) Xcode 14 工作正常,但在 Xcode 15 中停止工作。
我尝试使用 Xcode 15 预览版、.sizeThatFits 和 .fixed
https://i.stack.imgur.com/2DhEl.gif
#Preview {
AddRegionView()
.previewLayout(.fixed(width: 100, height: 100))
// .previewLayout(.sizeThatFits)
}
Run Code Online (Sandbox Code Playgroud) 我有 Xcode 版本 15.0 (15A240d),在成功存档后在应用商店上传时出现以下错误。我检查了我的配置文件和证书是否有效,并且我能够在 XCode 14.3.1 上上传应用程序。
错误1: "No profiles for 'bundle Identifier' were found. Xcode couldn't find any iOS App Store provisioning profiles matching 'bundle Identifier'."
错误2: "Cloud signing permission error
You haven't been given access to cloud-managed distribution certificates. Please contact your team's Account Holder or an Admin to give you access. If you need further assistance, contact Apple Developer Program Support at https://developer.apple.com/contact/."
我尝试过以下解决方案:
检查配置文件和证书的有效性。
现在TipKit已经由Apple发布并且应该可以在Xcode 15 beta 5上运行,我不知道如何将aTip与视图集成?
我有以下代码:
import SwiftUI
struct TipKitTestView: View {
var body: some View {
VStack {
Text("Some filler text")
UselessTip()
}
}
}
struct UselessTip: Tip {
var title: Text {
Text("Useless title")
}
var message: Text {
Text("Some useless message that is a bit longer than the title.")
}
}
Run Code Online (Sandbox Code Playgroud)
编译器不喜欢我有UselessTip()inside TipKitTestView,给出错误:Static method 'buildExpression' requires that 'UselessTip' conform to 'View'。我怎样才能编译代码?我不知道如何使提示成为视图,如果这有意义的话。
顺便说一句,什么代码可以使提示在 UIKit 中工作?我正在尝试结合使用 SwiftUI 和 UIKit 代码向我的项目添加提示,因此我不知道如何将提示集成到主要包含 UIKit 代码的项目中。有谁知道这是怎么做到的吗?
\xe2\x80\x9cExpand Macro\xe2\x80\x9d 保持灰色,即使我\xe2\x80\x99ve 看到@Observable之前已经看到宏扩展。
但是,当我手动触发构建错误时,它确实会扩展错误的位置。在这种情况下,我的目标是不支持的 macOS 13.5ObservationRegistrar.
我尝试重新启动 Xcode,尝试不同的宏、不同的项目和项目类型。
\n我使用的"react-native": "0.72.3"是 Xcode 14,一切都运行良好,但是当我将 Xcode 更新到Xcode 15时。然后它给出如下错误
注意:我使用的是 Live Activity 和 Dynamic Island 小部件扩展以及两个通知小部件扩展。
\nShowing Recent Messages\nCycle inside <Target>; building could produce unreliable results.\nCycle details:\n\xe2\x86\x92 Target \'<Target>\': ExtractAppIntentsMetadata\n\xe2\x97\x8b Target \'<Target>\' has copy command from \'/Users/apple/Library/Developer/Xcode/DerivedData/<Target>-hifbytcglbabrcgbkmfgnzgmwpmj/Build/Products/Debug-iphoneos/LiveActivityDynamicIslandExtension.appex\' to \'/Users/apple/Library/Developer/Xcode/DerivedData/<Target>-hifbytcglbabrcgbkmfgnzgmwpmj/Build/Products/Debug-iphoneos/<Target>.app/PlugIns/LiveActivityDynamicIslandExtension.appex\'\n\xe2\x97\x8b That command depends on command in Target \'<Target>\': script phase \xe2\x80\x9c[CP-User] [RNFB] Core Configuration\xe2\x80\x9d\n\xe2\x97\x8b Target \'<Target>\' has process command with output \'/Users/apple/Library/Developer/Xcode/DerivedData/<Target>-hifbytcglbabrcgbkmfgnzgmwpmj/Build/Products/Debug-iphoneos/<Target>.app/Info.plist\'\n\xe2\x97\x8b Target \'<Target>\' has copy command from \'/Users/apple/Library/Developer/Xcode/DerivedData/<Target>-hifbytcglbabrcgbkmfgnzgmwpmj/Build/Products/Debug-iphoneos/LiveActivityDynamicIslandExtension.appex\' to \'/Users/apple/Library/Developer/Xcode/DerivedData/<Target>-hifbytcglbabrcgbkmfgnzgmwpmj/Build/Products/Debug-iphoneos/<Target>.app/PlugIns/LiveActivityDynamicIslandExtension.appex\'\nRun Code Online (Sandbox Code Playgroud)\n\n