【发布时间】:2022-11-01 11:02:54
【问题描述】:
所以我试图在我的一个视图上屏蔽和使用透明度,但我似乎无法弄清楚如何正确屏蔽一半的视图,然后让其余的保持清晰。
所以这是我正在使用的代码:
// Onboarding Video
OnboardingVideoView(
videoName: "OnboardingVideo"
)
.mask(alignment: .bottom) {
LinearGradient(
stops: [
Gradient.Stop(color: .clear, location: .zero),
Gradient.Stop(color: .accentColor, location: 1.0)
],
startPoint: .bottom,
endPoint: .center
)
}
.ignoresSafeArea(.all)
问题:
【问题讨论】: