williewangwei / swiftui-tutorials Goto Github PK
View Code? Open in Web Editor NEWA code example and translation project of SwiftUI. / 一个 SwiftUI 的示例、翻译的教程项目。
Home Page: https://github.com/WillieWangWei/SwiftUI-Tutorials
License: MIT License
A code example and translation project of SwiftUI. / 一个 SwiftUI 的示例、翻译的教程项目。
Home Page: https://github.com/WillieWangWei/SwiftUI-Tutorials
License: MIT License
升级完成 想要跑一下,很多编译错误,希望作者能修改一下。谢谢
构建列表那篇,cell里漏了一句Spacer,不然cell是居中的
struct BadgeBackground: View {
var body: some View {
GeometryReader { geometry in
Path { path in
var width: CGFloat = min(geometry.size.width, geometry.size.height)
let height = width
let xScale: CGFloat = 0.832
let xOffset = (width * (1.0 - xScale)) / 2.0
width *= xScale
path.move(
to: CGPoint(
x: xOffset + width * 0.95,
y: height * (0.20 + HexagonParameters.adjustment)
)
)
HexagonParameters.points.forEach {
path.addLine(
to: .init(
x: xOffset + width * $0.useWidth.0 * $0.xFactors.0,
y: height * $0.useHeight.0 * $0.yFactors.0
)
)
path.addQuadCurve(
to: .init(
x: xOffset + width * $0.useWidth.1 * $0.xFactors.1,
y: height * $0.useHeight.1 * $0.yFactors.1
),
control: .init(
x: xOffset + width * $0.useWidth.2 * $0.xFactors.2,
y: height * $0.useHeight.2 * $0.yFactors.2
)
)
}
}
.fill(LinearGradient(
gradient: .init(colors: [Self.gradientStart, Self.gradientEnd]),
startPoint: .init(x: 0.5, y: 0),
endPoint: .init(x: 0.5, y: 0.6)
))
/////////////////////// 👇
//.aspectRatio(1, contentMode: .fit) // 这里是错误的
}
/////////////////////// 👇
.aspectRatio(1, contentMode: .fit) // 应该放在这里
}
static let gradientStart = Color(red: 239.0 / 255, green: 120.0 / 255, blue: 221.0 / 255)
static let gradientEnd = Color(red: 239.0 / 255, green: 172.0 / 255, blue: 120.0 / 255)
}
After I downloaded from github, I want to run it. But there are too many swift compiler errors. "Missing flies", or "Unable to infer complex closure return type; add explicit type to disambiguate" etc.
在处理用户输入章节中,在列表只显示收藏的情况下, 点击cell 进入详情, 此时在点击详情中的星星按钮,会出现取消收藏并返回到上一个页面的问题, 按理说代码中应该是只出现取消收藏, 而不应该有返回到上一个页面动作
可以修改下图片的大小,markDown 可以支持修改图片大小的 , 这样用起来 排版效果更好 , 谢谢您的教程
我装了xc11,启动的第一个sample时候预览不了,报Keyword '_' cannot be used as an identifier here。发现是在_xctest.swift这个文件里有报错,
import XCTest
@testable import _
class _Tests: XCTestCase {
请问如何解决啊
Landmark.swift 这个文件中 ‘ ImageStore’ 报 ‘Use of unresolved identifier 'ImageStore'’
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.