Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load image within TabItem in TabView 🤔 #295

Open
foxmayurrathod opened this issue Jan 10, 2024 · 2 comments
Open

Unable to load image within TabItem in TabView 🤔 #295

foxmayurrathod opened this issue Jan 10, 2024 · 2 comments

Comments

@foxmayurrathod
Copy link

I'm facing an issue while trying to load an image within a TabItem. I've attempted wrapping it in an HStack and applying the renderingMode, but the image isn't loading. Interestingly, when using AsyncImage, it works without a hitch. Any thoughts on why this might be occurring?

struct ContentView: View {
    
    var body: some View {
        TabView {
            FirstView()
                .tabItem {
                    Text("Menu")
                    HStack {
                        WebImage(url: URL(string: "https://fastly.picsum.photos/id/1/28/28.jpg?hmac=OWquhtLXviFlCON5jtuT0w-nHs_vBlUnSTt9OpBbk14"))
                            .resizable()
                            .renderingMode(.template)
                            
                    }
                }
            
            SecondView()
                .tabItem {
                    Text("Order")
                    AsyncImage(url: URL(string: "https://fastly.picsum.photos/id/1/28/28.jpg?hmac=OWquhtLXviFlCON5jtuT0w-nHs_vBlUnSTt9OpBbk14"))
                }
        }
    }
}

Output:

Screenshot 2024-01-10 at 12 38 36 PM
@dreampiggy
Copy link
Collaborator

Emmm...Need to test this.

Curious, is there using image from web, even the animated GIF, a normal usgae ?

@foxmayurrathod
Copy link
Author

@dreampiggy I haven't tested the animated GIF yet, so I'm unsure about that. Regarding images from the web, I encountered an issue. However, when I load the same image in the View Body, it works without any problems

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants