generated from shilokuma-inc/template-app-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from shilokuma-inc/feat/quizNumberView
【FEAT】問題の数字を上部に固定で表示
- Loading branch information
Showing
5 changed files
with
81 additions
and
13 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
PrimePickApp/ColorAssets.xcassets/appGreen.colorset/Contents.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"colors" : [ | ||
{ | ||
"color" : { | ||
"color-space" : "srgb", | ||
"components" : { | ||
"alpha" : "1.000", | ||
"blue" : "0x77", | ||
"green" : "0xDD", | ||
"red" : "0x77" | ||
} | ||
}, | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// | ||
// QuizNumberView.swift | ||
// PrimePickApp | ||
// | ||
// Created by 村石 拓海 on 2024/05/17. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct QuizNumberView: View { | ||
@Binding var quizNumber: Int | ||
let quizData: [PrimeQuizEntity] | ||
|
||
var body: some View { | ||
ZStack { | ||
Color("appGreen") | ||
.opacity(0.5) | ||
.edgesIgnoringSafeArea(.all) | ||
|
||
RoundedRectangle(cornerRadius: 25) | ||
.stroke(Color.green, lineWidth: 5) // 緑色の枠線と角丸 | ||
.background(RoundedRectangle(cornerRadius: 25).fill(Color.white)) // 背景を白にする | ||
.frame(width: 300, height: 200) // フレームサイズを指定 | ||
.shadow(radius: 10) // シャドウを追加して立体感を出す | ||
|
||
Text(quizData[quizNumber].number.description) | ||
.font(.custom("ArialRoundedMTBold", size: 180)) | ||
.foregroundStyle(Color.gray) | ||
} | ||
} | ||
} | ||
|
||
struct QuizNumberView_Previews: PreviewProvider { | ||
@State static var quizNumber = 3 | ||
|
||
static var previews: some View { | ||
QuizNumberView(quizNumber: $quizNumber, quizData: [PrimeQuizEntity(quizId: 0, number: 3, isCorrect: true)]) | ||
} | ||
} |
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