最早看到这个电子木鱼是在抖音刀叔的视频中,最近貌似在圈内火了,恰逢课上在讲多媒体编程,简单实现一个。
- SwiftUI 搭建界面与动画。
import SwiftUI
struct ContentView: View {
@State private var title = "功德值"
@State private var total = 0
@State private var once = 1
@State private var isTapped = false
var body: some View {
NavigationView {
VStack {
if isTapped {
Text("(title) (once)