Fix the button misalignment in the modal sheet #2

Closed
opened 2025-10-14 15:53:47 -06:00 by navan · 0 comments
Owner

Originally created by @s-n-1-0 on 12/9/2023

Thank you for this very nice library.
When using ConcentricOnboardingView in modal, the background color of the Button is misaligned.
The reason is that the position of Circle is based on the screen size.
This fixed code 9004c2f0b5 calculates the y-axis position of the button by frame size, not by screen size.

struct ContentView: View {
    
    @State private var isModal = false
    
    var body: some View {
        Button(action:{
            isModal.toggle()
        }){
            Text("Button")
        }.sheet(isPresented: $isModal){
            ConcentricOnboardingView(pageContents: [(AnyView(Text("Hello")),.blue),
                                                    (AnyView(Text("Hello2")),.green)])
        }
    }
}

Below is my environment.

  • iOS 16.4 emulator
  • Xcode 14.3
  • ConcentricOnboarding 1.0.4
*Originally created by @s-n-1-0 on 12/9/2023* Thank you for this very nice library. When using ConcentricOnboardingView in modal, the background color of the Button is misaligned. The reason is that the position of Circle is based on the screen size. This fixed code 9004c2f0b569c6504b535d0cce39ae13e6cbf79b calculates the y-axis position of the button by frame size, not by screen size. <img src="https://github.com/exyte/ConcentricOnboarding/assets/72431055/9c357408-98a5-4ead-8b1e-3b1801fbe7dd" height="500px"> ```swift struct ContentView: View { @State private var isModal = false var body: some View { Button(action:{ isModal.toggle() }){ Text("Button") }.sheet(isPresented: $isModal){ ConcentricOnboardingView(pageContents: [(AnyView(Text("Hello")),.blue), (AnyView(Text("Hello2")),.green)]) } } } ``` Below is my environment. + iOS 16.4 emulator + Xcode 14.3 + ConcentricOnboarding 1.0.4
navan closed this issue 2025-10-14 15:53:48 -06:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github/ConcentricOnboarding#2
No description provided.