PopupView icon indicating copy to clipboard operation
PopupView copied to clipboard

Why does my view always pop up from the bottom right of the screen?

Open X0217 opened this issue 2 years ago • 3 comments

First I have a RoomCommonAlertView.

struct RoomCommonAlertView: View { @Binding var closeView:Bool var body: some View { VStack(spacing: 30){

         Text("title").foregroundColor(RGB(51, 51, 51)).font(Font.system(size: 16,weight: .semibold)).multilineTextAlignment(.center).padding(.leading,10).padding(.trailing,10).padding(.top,15)
         
         HStack(spacing: 17){
             Text("sure").foregroundColor(RGB(179, 179, 179)).font(Font.system(size: 14,weight: .medium)).frame(width: 84,height: 30).background(RGB(255, 255, 255))

             Text("cancel").foregroundColor(RGB(255, 255, 255)).font(Font.system(size: 14,weight: .medium)).frame(width: 84,height: 30).background(RGB(143, 103, 255))
         }.padding(.bottom,12)
     }.frame(width: 295).frame(minHeight: 135).background(Color.white).cornerRadius(14)
 }

}

And use it

.popup(isPresented: $isPop) { RoomCommonAlertView(closeView: $isPop) } customize: { $0 .closeOnTap(false) .closeOnTapOutside(true) .backgroundColor(.black.opacity(0.5)) }

But it will pop up from the bottom right of the screen, how can I make it pop up from the bottom center every time? Here is the link to my demo video: https://www.youtube.com/shorts/ufa2qFP9RLk

X0217 avatar Jan 17 '24 04:01 X0217

Forgot to mention, my ExytePopupView version is 2.6.0

X0217 avatar Jan 17 '24 04:01 X0217

I seem to have found the problem. I have two views, viewA and viewB, both of which pop up. In the closing event of viewA, set the binding property of viewB to true. At this time, viewB will pop up from the bottom right. If Add a 0.3 second delay, wait until viewA closes the animation, then pop up viewB and everything will be normal. How to solve this problem? If you add a 0.3 second delay to each nest, it will be a bit troublesome.

X0217 avatar Jan 17 '24 05:01 X0217

Hey @X0217 , please provide full minimal compilable example. Please make sure it compiles and the issue reproduces on this minimal example. Have a nice day

f3dm76 avatar Feb 14 '24 10:02 f3dm76

It's been a while, so I'll close this one for now. Please feel free to reopen if you are still having the issue. Please be sure to attach minimal compilable reproducible example. Have a nice day!

f3dm76 avatar Mar 07 '24 09:03 f3dm76