-contentView-

66라인이 포인트

//
//  ContentView.swift
//  Swift_stack_practice_tutorial
//
//  Created by devdepot on 2021/04/27.
//

import SwiftUI

struct ContentView: View {
    
    @State var isNavigationBarHidden : Bool = false
    
    var body: some View {
        NavigationView{
            ZStack(alignment: .bottomTrailing){
                
                VStack(alignment:.leading){
                    
                    HStack{
                        NavigationLink(
                            destination: MyList(),
                            label: {
                                Image(systemName: "line.horizontal.3")
                                    .font(.largeTitle)
                                    .foregroundColor(.black)
                            })
                            
                        Spacer()
                        Image(systemName: "person.crop.circle.fill")
                            .font(.largeTitle)
                    }.padding(.horizontal,20)
                    
                    Text("이일팔 할 일 목록")
                        .fontWeight(.bold)
                        .font(.system(size: 30))
                        
                    ScrollView{
                        VStack{
                            MyProjectCard()
                            MyBasicCard()
                            MyCard(icon: "doc.fill", title: "책읽기", start: "오전 9시", end: "오후 3시", bgColor: Color.green)
                            MyCard(icon: "tray.fill", title: "책읽기", start: "오전 9시", end: "오후 3시", bgColor: Color.green)
                            MyCard(icon: "doc.fill", title: "책읽기", start: "오전 9시", end: "오후 3시", bgColor: Color.green)
                            MyCard(icon: "doc.fill", title: "책읽기", start: "오전 9시", end: "오후 3시", bgColor: Color.green)
                            MyCard(icon: "doc.fill", title: "책읽기", start: "오전 9시", end: "오후 3시", bgColor: Color.green)
                        }
    //                    .padding()
                    }
                }.padding(.top,20)
                .padding(.horizontal,20)
                
            
                
                Circle()
                    .frame(width: 50, height: 50,alignment: .center)
                    .foregroundColor(.yellow)
                    .overlay(Image(systemName: "plus")
                                .font(.system(size: 30))
                                .foregroundColor(.white))
                    .padding(.trailing,10)
                    .shadow(radius: 20)
            }//zstack
            
            .navigationBarTitle("메인")
            .navigationBarHidden(self.isNavigationBarHidden)
            .onAppear{
                self.isNavigationBarHidden = true;
            }
            
        }   //navigation view
       
       
        
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}

-MyList-

//
//  MyList.swift
//  Swift_stack_practice_tutorial
//
//  Created by devdepot on 2021/04/27.
//

import SwiftUI


struct MyList : View {

    
    var body: some View{
       
//        List{
//            Text("마이리스트")
//            Text("마이리스트")
//            Text("마이리스트")
//            Text("마이리스트")
//            Text("마이리스트")
//            Text("마이리스트")
//        }
        
//        List{
//            ForEach(1...10, id: \.self){
//                Text("마이리스트 \($0)")
//            }
//        }
//        Text("마이리스트")
        
        List{
            Section(header: Text("오늘 할일")
                        .font(.headline),footer: Text("푸터")){
                ForEach(1...3, id: \.self){ itemIndex in
                   
                    
                    MyCard(icon: "doc.fill", title: "책읽기\(itemIndex)", start: "오전 9시", end: "오후 3시", bgColor: Color.green)
                }
            }.listRowInsets(EdgeInsets.init(top:10,leading: 10,bottom: 10,trailing: 10))  //행 간격
            .listRowBackground(Color.yellow)
            
            Section(header: Text("내일 할일")){
                ForEach(1...20, id: \.self){ itemIndex in
                   
                    
                    MyCard(icon: "doc.fill", title: "책읽기\(itemIndex)", start: "오전 9시", end: "오후 3시", bgColor: Color.blue)
                }
            }
            
            Section(header: Text("헤더입니다.")){
                ForEach(1...3, id: \.self){ itemIndex in
                   
                    
                    MyCard(icon: "doc.fill", title: "책읽기\(itemIndex)", start: "오전 9시", end: "오후 3시", bgColor: Color.yellow)
                }
            }
           
        }
        .listStyle(GroupedListStyle())
        .navigationBarTitle("내 목록") //네비게이션 바 타이틀
    }
}


struct MyList_Previews: PreviewProvider {
    static var previews: some View {
        MyList()
    }
}

'IOS > SwiftUI' 카테고리의 다른 글

(SwiftUI)11.탭뷰  (0) 2021.04.28
(SwiftUI)10.GeometryReader,enum,애니메이션  (0) 2021.04.28
(SwiftUI)08. 동적 뷰 넣기, 스택 연습,Alert  (0) 2021.04.27
(SwiftUI)07.Stack 정리  (0) 2021.04.27
(SwiftUI)06.CircleImage  (0) 2021.04.27

+ Recent posts