Yeah its correct since i have used toolbar items i dont want take the other view to take the whole phone screen space
also i dont want back button i just need to show the other view and simultaneously highlight the toolbar button
so is there any possible way to site other view through button ….
Post
Replies
Boosts
Views
Activity
also I have doubt I have created this code in separate SwiftUI File (MapView)
let say if I call it in ContentView like MapView()
the location button is not functioning as it is programmed (in here it is programmed to show the current location but after calling the MapView in ContentView, the button is not working)
how should I make this button work after calling the MapView File in Content View
I will try it and update it today thanks for the code👍
oh I get it thanks👍🏻
Exactly the thing I needed ,Thanks
also if some need extra help watch this Youtube video
https://youtu.be/Zrp7RzAwm8Q
Yes you are correct
Yeah your right i found out the mistake
I need a button in my app , when i click that button it should open the iPhone settings app and automatically navigate through the location settings
Doesn’t work means it throws error on Json decoder in catch statement
it throws this error only for the first code not for the second cide below the comment
although those two code looks similar to me do you find any differences in these two codes (above and below the comment)
Nope not yet thanks
the CardView is just toggle opening how to add CardView to open as full Screen when the button is pressed
Ok i will try and update
and here is the image
import SwiftUI
struct CardView: View {
var body: some View {
ZStack {
Color.background
.ignoresSafeArea()
HStack{
Image(systemName: "chevron.backward")
.foregroundColor(Color.white)
Spacer()
Text("Wallet")
.foregroundColor(Color.white)
Spacer()
Image(systemName: "ellipsis")
.foregroundColor(Color.white)
}
.padding()
.padding(.top, -400.0)
HStack(alignment: .top){
Text("Cards Wallet")
.foregroundColor(Color.white)
}
.padding(.top, -325.0)
//MARK: View Bar is added
ZStack{CardViewBar()
.fill(Color.background_1)
.frame(width: 350, height: 3)
CardViewBar()
.fill(Color.CardViewBar)
.frame(width:175,height: 3)
.padding(.leading, -175.0)
}
.padding(.bottom, 575.0)
//MARK: Credit Card is Stacked
ZStack{
Image("Credit Card 3")
.padding(.bottom, 80.28)
Image("Credit Card 2")
.padding(.bottom, 40.14)
Image("Credit Card 1")
}
.padding(.bottom, 200.0)
ScrollCircle()
.fill(Color.background_1)
.frame(width: 10, height: 10, alignment: .center)
.padding(.top, 90.0)
ScrollCircle()
.fill(Color.background_1)
.frame(width: 10, height: 10, alignment: .center)
.padding([.top, .leading], 90.0)
ScrollCircle()
.fill(Color.CardViewBar)
.frame(width: 10, height: 10, alignment: .center)
.padding([.top, .trailing], 90.0)
Image("Icons Menu")
.padding(.top, 225.0)
ZStack {
DropDownBar()
.fill(Color.background_1)
.frame(width: 350, height: 250)
.padding(.top, 600.0)
VStack {
HStack {
Image(systemName: "plus")
.resizable()
.frame(width: 24, height: 24)
Text("Add Card")
.font(.title)
.fontWeight(/*@START_MENU_TOKEN@*/.bold/*@END_MENU_TOKEN@*/)
}
.padding(.trailing, 150.0)
.padding(.top, 100.0)
Text("Add your debit/credit card")
.font(.body)
.fontWeight(.bold)
.foregroundColor(Color("Background"))
.padding(.top, -12.0)
.padding(.trailing, 60.0)
ZStack {
ListRectShape()
.fill(Color.background)
.frame(width: 310, height: 44)
.padding(.top, 15.0)
Text("Card Number")
.font(.body)
.padding(.trailing, 150.0)
.padding(.top)
}
ZStack {
ListRectShape()
.fill(Color.background)
.frame(width: 310, height: 44)
.padding(.top, 22.0)
Text("Card Holder Name")
.font(.body)
.padding(/*@START_MENU_TOKEN@*/.trailing, 110.0/*@END_MENU_TOKEN@*/)
.padding(.top, 25.0)
}
}
.padding(.top, 500.0)
.foregroundColor(Color.white)
}
}
}
}
struct CardView_Previews: PreviewProvider {
static var previews: some View {
CardView()
}
}
This code perfectly working but my CardView is so much smaller than the original here is the photo graph