โœจviews with same width

ๅˆฉ็”จ PreferenceKey ไพ†ๅฐ้ฝŠๆœฌไพ†ๅฏฌๅบฆไธๅŒ็š„ TextFieldใ€‚

// โญ๏ธ PreferenceKey๏ผš
//    1. ๆบ–ๅ‚™ๆŽฅๆ”ถๆ‰€ๆœ‰ Text ็š„ๆœ€ๅคงๅฏฌๅบฆใ€‚
typealias MaxWidth = MaxValue<CGFloat>  // ๐Ÿ“ฆ MaxValue<T: FloatingPoint>

// live view
struct ContentView: View {
    var body: some View {
        VStack {
            MyForm()                     // ๐ŸŒ… MyForm
            Color.pink.cornerRadius(12)
        }
            .padding()
            .background(Color.gray)
            .cornerRadius(16)
            .shadow(color: .black, radius: 6, x: 6, y: 6)
    }
}

ไฟฎๆ”น็ด€้Œ„

Last updated