LoaderUI icon indicating copy to clipboard operation
LoaderUI copied to clipboard

Centering the Indicators seem to be ignored

Open houmie opened this issue 1 year ago • 3 comments

I'm not sure if this is a new bug:

I don't seem to be able to centre them horizontally.

HStack {
    Spacer()
    BallPulse()
    Spacer()
}

Screenshot 2024-05-06 at 11 07 54

It remains always left aligned.

Am I missing something?

houmie avatar May 06 '24 10:05 houmie

Is the entire body of the view? In the above example, Spacer doesn't seem to be necessary to center the indicator horizontally. I try the example and the indicator takes full width of the screen

ninjaprox avatar May 10 '24 13:05 ninjaprox

I figured it out. :-)

It needs the frame, otherwise you get to see what I posted above. Quite strange.

VStack {
    Spacer()
    BallPulse().frame(width: 80, height: 80)
    Spacer()
}

houmie avatar May 10 '24 14:05 houmie

Is VStack or HStack a child of another view? Could you share the entire view body? I guess it's not the entire body of the view, otherwise you won't have the issue and don't need Spacer to center the indicator.

ninjaprox avatar May 10 '24 15:05 ninjaprox