目录
目录README.md

BottomSheet-SwiftUI

BottomSheet view in SwiftUI

Based on: https://gist.github.com/mecid/78eab34d05498d6c60ae0f162bfd81ee

Usage

import SwiftUI
import BottomSheet_SwiftUI

struct ContentView: View {
    @State private var bottomSheetOpened = false
    var body: some View {
        GeometryReader { geometry in
            Color.green
                .edgesIgnoringSafeArea(.all)
            BottomSheet(
                isOpen: self.$bottomSheetOpened,
                config: BottomSheetConfig(maxHeight: geometry.size.height * 0.9)
            ) {
                Color.white
            }
        }.edgesIgnoringSafeArea(.all)
    }
}

Default config values

minHeightRatio: 0.2,
maxHeight: 300,
radius: 20,
indicatorSize: width: 100, height: 5,
snapRatio: 0.1,
indicatorColor: black,
indicatorBackgroundColor: white

Installation

Swift Package Manager

BottomSheet-SwiftUI is SwiftPM-compatible. To install, add this package to your Package.swift or your Xcode project.

关于
31.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号