Yes,I have same problem.
Any one fix the problem?
Here is my sample code:
struct BroadcastLiveActivityGradientLayerView: View {
@Environment(.colorScheme) var colorScheme
private var localImageName: String {
colorScheme == .light ? "icon_LiveActivity_broadcast_grid_light" : "icon_LiveActivity_broadcast_grid_dark"
}
private var baseBackgroundColor: Color {
colorScheme == .dark ? .black : .white
}
var body: some View {
ZStack(alignment: .topTrailing) {
baseBackgroundColor
let colors = LiveActivityColor.broadcastBackgroundColors(colorScheme)
LinearGradient(
stops: [
.init(color: colors.last ?? .clear, location: 0.0),
.init(color: colors.first ?? .clear, location: 1.0)
],
startPoint: UnitPoint(x: 0.81, y: 1.29),
endPoint: UnitPoint(x: 1.29, y: 0.17)
)
Image(localImageName)
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: 179, height: 149)
}
}
}
Topic:
App & System Services
SubTopic:
Widgets & Live Activities
Tags: