IT アプリ開発

【SwiftUI】一部のViewの中でスクロール

import SwiftUI

struct TutorialView:View{
    
    var body: some View{
        VStack(){
            VStack(){
                VStack(){
                    TabView{
                        Text("チュートリアル1")
                            .frame(width: 300, height: 500)
                            .background(Color(red: 0.8, green: 0.8, blue: 0.8))     //lightgray
                            .tag(0)
                        Text("チュートリアル2")
                            .frame(width: 300, height: 500)
                            .background(Color(red: 0.6, green: 0.99, blue: 0.6))     //palegreen
                            .tag(1)
                        Text("チュートリアル3")
                            .frame(width: 300, height: 500)
                            .background(Color(red: 1, green: 0.75, blue: 0.78))     //pink
                            .tag(2)
                    }
                    .tabViewStyle(PageTabViewStyle())
                    .indexViewStyle(PageIndexViewStyle(backgroundDisplayMode: .always))
                }
                .frame(width: 300, height: 500)
                .background(
                    RoundedRectangle(cornerRadius: 0)
                        .stroke(Color.gray, lineWidth: 2)
                )
                
            }
            .frame(width: 400, height: 700)   // frameを作成
            .overlay(
                RoundedRectangle(cornerRadius: 50)
                    .stroke(Color(red: 0.83, green: 0.6, blue: 0.83, opacity: 0.2), lineWidth: 2)
            )
            .background(
                RoundedRectangle(cornerRadius: 50, style: .continuous).fill(Color(red: 0.83, green: 0.6, blue: 0.83, opacity: 0.8))
            )
        
            //.background(Color(red: 0.83, green: 0.6, blue: 0.83))   //plum
        }
    }
}

-IT, アプリ開発
-

© 2024 Yosshi Labo. Powered by AFFINGER5