SDWebImage / SDWebImageSwiftUI

SwiftUI Image loading and Animation framework powered by SDWebImage
https://sdwebimage.github.io/SDWebImageSwiftUI
MIT License
2.09k stars 214 forks source link

Does not work on tvOS borderless style #320

Closed zijiaZ closed 1 week ago

zijiaZ commented 3 weeks ago

Based on the doc https://developer.apple.com/documentation/swiftui/primitivebuttonstyle/borderless, On tvOS, this borderless style has a default hover effect, WebImage does not have it, but AsyncImage does.

dreampiggy commented 2 weeks ago

😂

Using WebImage's own modifier inside Button has known issue. Because there are some special handing in SwiftUI internal (Image is the basic building block actually)

From v3.0.0, you can use the AsyncImage like API, which you receive a WebImagePhase and you can get a SwiftUI.Image to do customization after downloaded, maybe that one helps.

dreampiggy commented 2 weeks ago
    WebImage(url: URL(string: "https://nokiatech.github.io/heif/content/images/ski_jump_1440x960.heic")) { image in
        image.resizable()
        image.buttonStyle(.borderless)
    }

instead of:

    WebImage(url: URL(string: "https://nokiatech.github.io/heif/content/images/ski_jump_1440x960.heic"))
    .resizable()
    .buttonStyle(.borderless)
dreampiggy commented 2 weeks ago

Does this helps ? If so you can close this issue.