Created
November 9, 2019 17:45
-
-
Save badrinathvm/b9dfad4c8d032e67934d7435001ecb0f to your computer and use it in GitHub Desktop.
Text Not expanding it's size when placed inside ScrollView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import SwiftUI | |
struct MoreCircleShapes: View { | |
var body: some View { | |
VStack(spacing: 10) { | |
Circle().fill(Color.purple).frame(height: 100).padding() | |
Text("Note : Fill Modifier apples specifically to shapes nopt a view.") | |
.frame(maxWidth: .infinity) | |
.padding() | |
.background(Color.purple) | |
.foregroundColor(Color.white) | |
.layoutPriority(2) | |
Circle().foregroundColor(Color.purple).frame(height: 100).padding() | |
}.font(.title) | |
} | |
} | |
struct CircularShapes: View { | |
var body: some View { | |
ScrollView(Axis.Set.vertical) { | |
VStack(spacing: 10){ | |
Text("There are three circular shapes available in SwiftUI") | |
.padding() | |
.frame(maxWidth : .infinity) | |
.foregroundColor(Color.white) | |
.background(Color.purple) | |
.layoutPriority(1) | |
Text("Circle") | |
Circle().padding() | |
Text("Capsule") | |
Capsule().frame(height: 60).padding() | |
Text("Ellipse") | |
Ellipse().frame(height: 60).padding() | |
Text("Rounded Cornered Capsule") | |
Capsule(style: RoundedCornerStyle.circular).frame(height: 60).padding() | |
MoreCircleShapes() | |
}.font(.title) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment