我非常有兴趣安装要求安装可可豆荚的GitHub程序之一。在macOS普通版上,我的终端似乎没有问题。我有一个问题,终端不是安装可可豆荚,因为我在macOS Catalina beta上?
我确实Podfile
完成了Pod'Card'的安装,但是之后Podfile
就关闭了。我要在终端上输入文本“ pod install”,这是我得到的唯一错误。错误说
-bash: /usr/local/bin/pod: /
System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: bad interpreter: No such file or directory".
Run Code Online (Sandbox Code Playgroud)
当我使用MacOS Catalina beta时,有人知道如何解决这些问题吗?
我在 SwiftUI 中找到了允许您创建指数的新方法。
这里我编写的代码基于 Swift Playground 上的 SwiftUI。
import SwiftUI
import PlaygroundSupport
struct V: View {
var body: some View {
HStack {
Text("8")
Text("2\n").font(Font.system(size: 10))
}
}
}
PlaygroundPage.current.setLiveView(V())
Run Code Online (Sandbox Code Playgroud)
\n 允许您在 UIKit 中断行并创建新行。但是,SwiftUI 可以让您在断行时创建顶部并在第二个文本内创建一个新行。您可以在文本中为字体设置大小。
就是这样!您在 SwiftUI 中创建了指数!
我试图在带有 #available 的 if 语句中删除 iOS 13 中的导航栏背景。我知道在 else 语句中删除 iOS 12 和旧版 iOS 导航栏背景的原始代码。但是,Apple 确实在任何地方宣布了一个名为Appearance的新系统,以支持新的 iOS 13 系统。
let app = UINavigationBarAppearance()
let navigationBar = self.navigationController?.navigationBar
app.configureWithOpaqueBackground()
app.shadowImage = UIImage()
self.navigationController?.navigationBar.scrollEdgeAppearance = app
navigationBar!.standardAppearance = app
navigationBar!.scrollEdgeAppearance = app
Run Code Online (Sandbox Code Playgroud)
我相信这个 configureWithOpaqueBackground() 允许我们删除导航栏背景,但我在 iOS 13.1 模拟器上测试出现黑色导航栏背景。我知道是什么原因造成的。
app.configureWithOpaqueBackground()
app.titleTextAttributes = [.foregroundColor: UIColor.white]
app.largeTitleTextAttributes = [.foregroundColor: UIColor.white]
app.backgroundColor = #colorLiteral(red: 0.1603881121, green: 0.1677560508, blue: 0.2133775949, alpha: 1)
Run Code Online (Sandbox Code Playgroud)
该代码允许我们将自定义颜色放在黑色背景上。我准备在 viewWillDisappear 的语句中添加该代码,以便在self.navigationController?.navigationBar.scrollEdgeAppearance = app
使用 remove app.configureWithOpaqueBackground()
和 之前将导航栏背景恢复为正常颜色背景app.shadowImage = …
我只是喜欢研究比 Swift 编程的基础知识更多的东西,并且实际上注意到一个非常熟悉的字典。如果您知道,您愿意向我解释这实际上意味着什么以及这些代码编程的名称吗?
代码结果:
// MARK: Dictionaries
var Weather = [String: String]()
Weather["Sunday"] = "Sunny"
// MARK: What does this with angle bracket syntax is called?
// Notice: It's seems familar to Dictionaries.
var Total_Miles = Dictionary<String, Int>()
Total_Miles["Antonio"] = 100
Run Code Online (Sandbox Code Playgroud)
谢谢你带来的帮助!:)