HomeiOS DevelopmentAny method to cover the row in white background in Record when...

Any method to cover the row in white background in Record when utilizing Context Menu SwiftUI?


Is there any method to cover the row that’s in white background when context menu seems? I do know it is due to Record. I had to make use of Record as a result of including ScrollView with LazyVStack on iOS 17, 18 had points when contents with various measurement seems like when keyboard dismissed the LazyVStack will not snap again. So I went with Record.

So when highlighting the precise message I need to know is it doable to cover that row behind it. If not then I feel I’ve to relay on UIKit for UITableVIew or UICollectionView which I must study first to implement this. LazyVStack is massive NO for me.

Any method to cover the row in white background in Record when utilizing Context Menu SwiftUI?

Record {
  ForEach(Array(messagesViewModel.messages.enumerated()), id: .aspect.messageIndex) {
    index, message in
    let isBeginning = message.messageIndex == messagesViewModel.messages.first?.messageIndex

    let isLast = message.messageIndex == messagesViewModel.messages.final?.messageIndex

    let hasBogey = messagesViewModel.bogeyChatSuggestions != nil

    chatMessageView(for: message, isBeginningOfSection: isBeginning)
      .buttonStyle(.plain)
      .id(message.messageIndex)
      .padding(.backside, hasBogey ? 0 : (isLast ? 65 : 0))
      .listRowSeparator(.hidden)
      .listRowBackground(Colour.clear)
      .contextMenu {
        Button("Copy") { UIPasteboard.basic.string = textual content }
      }
  }

  bogeyChatSuggestionView
    .id(messagesViewModel.bogeyChatSuggestions?.id)
    .listRowSeparator(.hidden)
    .listRowBackground(Colour.clear)
}
.buttonStyle(.plain)
.listStyle(.plain)
.scrollContentBackground(.hidden)
.scrollIndicators(.hidden)
.background(Colour.white)

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments