Comments (6)
Hey @AngelDev727, what is a modal loading? Can you please provide more details?
from activityindicatorview.
I meant this ActivityIndicator on modal view.
from activityindicatorview.
Have you tried using a .sheet and displaying your activity indicator there?
from activityindicatorview.
No, I haven't tried using .sheet
from activityindicatorview.
Hi, @AngelDev727 :)
I think you can make simply using ZStack
and additional View components the modal
screen you want.
Hereโs an simple example that Iโm using in a field project.
import SwiftUI
import ActivityIndicatorView
struct ContentView: View {
@State private var isVisible = false
var body: some View {
ZStack {
VStack {
Button {
self.isVisible.toggle()
} label: {
Text("Modal On/Off")
}
}
.padding()
VStack {
ZStack {
RoundedRectangle(cornerRadius: 20)
.fill(Color.white)
.frame(width: 100, height: 100)
ActivityIndicatorView(isVisible: $isVisible, type: .default())
.frame(width: 50.0, height: 50.0)
.foregroundColor(Color.blue)
}
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Color.gray.opacity(0.3))
.ignoresSafeArea() // need iOS 14.0 later
.isHidden(!isVisible)
.onTapGesture {
self.isVisible.toggle()
}
}
}
}
extension View {
@ViewBuilder func isHidden(_ isHidden: Bool) -> some View {
if isHidden {
self.hidden()
} else {
self
}
}
}
I hope it can help you.
have a good day. :)
from activityindicatorview.
It works as well.
Thank you
from activityindicatorview.
Related Issues (15)
- Error HOT 2
- tvOS support HOT 7
- Incompatible with NavigationView HOT 2
- Bool instead of Binding Bool Value HOT 7
- Border weight for circular views HOT 2
- Want to show in specific view HOT 3
- Can it support custom animation duration? HOT 1
- when navigate to another screen while Indicator is active, it is become very fast like crazy HOT 3
- Some animations not animating HOT 1
- Example project isn't working on Xcode 11.5 HOT 2
- More rounded HOT 2
- Build failure in Xcode 12 HOT 1
- If view size changes, the activity indicator (.gradient) slides left and right continuously HOT 1
- how to make a modal loading? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from activityindicatorview.