Skip to content

Instantly share code, notes, and snippets.

@badrinathvm
Created November 9, 2019 17:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save badrinathvm/b9dfad4c8d032e67934d7435001ecb0f to your computer and use it in GitHub Desktop.
Save badrinathvm/b9dfad4c8d032e67934d7435001ecb0f to your computer and use it in GitHub Desktop.
Text Not expanding it's size when placed inside ScrollView
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