diff --git a/DemoAppSwiftUI/ChannelHeader/CustomChannelHeader.swift b/DemoAppSwiftUI/ChannelHeader/CustomChannelHeader.swift index 63dd46248..e150c8246 100644 --- a/DemoAppSwiftUI/ChannelHeader/CustomChannelHeader.swift +++ b/DemoAppSwiftUI/ChannelHeader/CustomChannelHeader.swift @@ -30,6 +30,7 @@ public struct CustomChannelHeader: ToolbarContent { Image(uiImage: images.messageActionEdit) .resizable() .scaledToFit() + .frame(width: 24, height: 24) .foregroundColor(Color.white) .padding(.all, 8) .background(colors.tintColor) @@ -41,9 +42,12 @@ public struct CustomChannelHeader: ToolbarContent { Button { actionsPopupShown = true } label: { - StreamLazyImage(url: currentUserController.currentUser?.imageURL) - .accessibilityLabel("Account Actions") - .accessibilityAddTraits(.isButton) + StreamLazyImage( + url: currentUserController.currentUser?.imageURL, + size: CGSize(width: 36, height: 36) + ) + .accessibilityLabel("Account Actions") + .accessibilityAddTraits(.isButton) } } } @@ -62,13 +66,25 @@ struct CustomChannelModifier: ChannelListHeaderViewModifier { func body(content: Content) -> some View { ZStack { - content.toolbar { - CustomChannelHeader( - title: title, - currentUserController: chatClient.currentUserController(), - isNewChatShown: $isNewChatShown, - actionsPopupShown: $actionsPopupShown - ) + if #available(iOS 26, *) { + content.toolbar { + CustomChannelHeader( + title: title, + currentUserController: chatClient.currentUserController(), + isNewChatShown: $isNewChatShown, + actionsPopupShown: $actionsPopupShown + ) + .sharedBackgroundVisibility(.hidden) + } + } else { + content.toolbar { + CustomChannelHeader( + title: title, + currentUserController: chatClient.currentUserController(), + isNewChatShown: $isNewChatShown, + actionsPopupShown: $actionsPopupShown + ) + } } NavigationLink(isActive: $blockedUsersShown) { diff --git a/Sources/StreamChatSwiftUI/ChatChannel/ChannelHeader/ChatChannelHeaderViewModifier.swift b/Sources/StreamChatSwiftUI/ChatChannel/ChannelHeader/ChatChannelHeaderViewModifier.swift index 2931fb8ad..7246e1d7b 100644 --- a/Sources/StreamChatSwiftUI/ChatChannel/ChannelHeader/ChatChannelHeaderViewModifier.swift +++ b/Sources/StreamChatSwiftUI/ChatChannel/ChannelHeader/ChatChannelHeaderViewModifier.swift @@ -108,13 +108,25 @@ public struct DefaultChannelHeaderModifier: ChatChannelHea } public func body(content: Content) -> some View { - content.toolbar { - DefaultChatChannelHeader( - factory: factory, - channel: channel, - headerImage: channelHeaderLoader.image(for: channel), - isActive: $isActive - ) + if #available(iOS 26, *) { + content.toolbar { + DefaultChatChannelHeader( + factory: factory, + channel: channel, + headerImage: channelHeaderLoader.image(for: channel), + isActive: $isActive + ) + .sharedBackgroundVisibility(.hidden) + } + } else { + content.toolbar { + DefaultChatChannelHeader( + factory: factory, + channel: channel, + headerImage: channelHeaderLoader.image(for: channel), + isActive: $isActive + ) + } } } }