Created
April 12, 2020 06:53
-
-
Save wizard1066/64be606366651988986c7c2beaa68135 to your computer and use it in GitHub Desktop.
ddwtp1
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
struct dominoView: View { | |
@State var topNo:Int! | |
@State var lowNo:Int! | |
var body: some View { | |
return ZStack { | |
RoundedRectangle(cornerRadius: 5) | |
.stroke(Color.black, lineWidth: 2) | |
.frame(width: 48, height: 80, alignment: .top) | |
.background(Color.clear) | |
VStack { | |
HStack { | |
ForEach((0 ..< topNo), id: \.self) { column in | |
Circle() | |
.fill(Color.black) | |
.frame(width: 12, height: 12, alignment: .center) | |
.overlay( | |
RoundedRectangle(cornerRadius: 20) | |
.stroke(Color.clear, lineWidth: 2) | |
.frame(width: 32, height: 32, alignment: .center) | |
.background(Color.clear) | |
) | |
} | |
} | |
Divider() | |
.frame(width: 32, height: 2, alignment: .center) | |
HStack { | |
ForEach((0 ..< lowNo), id: \.self) { column in | |
Circle() | |
.fill(Color.black) | |
.frame(width: 12, height: 12, alignment: .center) | |
.overlay( | |
RoundedRectangle(cornerRadius: 10) | |
.stroke(Color.clear, lineWidth: 2) | |
.frame(width: 32, height: 32, alignment: .center) | |
.background(Color.clear) | |
) | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment