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

The size of the picture is not displayed properly in the waterfall flow #61

Open
wisepmlin opened this issue May 3, 2022 · 2 comments

Comments

@wisepmlin
Copy link

var coverRow: some View {
        VStack {
            if selectedTask.taskCover != nil {
                Image(uiImage: selectedTask.tTaskCover)
                    .resizable()
                    .aspectRatio(contentMode: .fit)
                    .cornerRadius(CGFloat.bl_4.double)
                    .blendMode(colorScheme == .dark ? .screen : .normal)
                    .opacity(colorScheme == .dark ? 0.75 : 0.85)
            } else {
                Button(action: {
                    isShowingImagePicker = true
                }, label: {
                    RoundedRectangle(cornerRadius: CGFloat.bl_4.double)
                        .fill(Color.s_c.opacity(0.35))
                        .frame(height: 180)
                        .overlay(Image(systemName: "photo").modifier(SK_20(textColor: Color.t_t_c, weight: .regular)))
                })
            }
        }
    }

IMG_D754DABDA12D-1

@AlexanderOtavka
Copy link

I've had the same problem. It seems to be caused when a resizable image is used in a card. If there aren't enough cards to force the grid container size large enough, the images will get squished.

I haven't found a workaround yet, but we either need to find a way to make the waterfall grid create enough space for the images to scale up to their full preferred height, or we need to find a way to tell our images to be more agressive and demand the vertical space they need.

You can reproduce this issue in the sample app either on the images or the cards view by modifying the generator code to only spit out one row's worth of images or cards.

@andrewpang
Copy link

I've had the same problem. It seems to be caused when a resizable image is used in a card. If there aren't enough cards to force the grid container size large enough, the images will get squished.

I haven't found a workaround yet, but we either need to find a way to make the waterfall grid create enough space for the images to scale up to their full preferred height, or we need to find a way to tell our images to be more agressive and demand the vertical space they need.

You can reproduce this issue in the sample app either on the images or the cards view by modifying the generator code to only spit out one row's worth of images or cards.

I also have this issue with resizable images in a card. Whenever I have 2 cards (in a 2 column grid), the images get squished into having 0 height (unless I specify a height on it's frame). Whenever I add a 3rd card which seems to make the grid container larger, then all the images display properly.

Does anyone have a fix for this? Even a hack to make it work properly for now?

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

No branches or pull requests

3 participants