011_swiftui_卡牌战争。比点数

喜欢而已 提交于 2020-04-11 17:53:29

效果图

使用到的资源图片

https://download.csdn.net/download/mp624183768/12320155

拖动到xcode后。记得修改名称

back->card1

Background->background

目的

主要是熟悉使用swiftUI中的布局。image。和Button的点击事件

和使用

源代码

//
//  ContentView.swift
//  SwiftUiWarCardGame
//
//  Created by liuan on 2020/4/10.
//  Copyright © 2020 liuan. All rights reserved.
//

import SwiftUI

struct ContentView: View {
    @State private var randNum1=1
    @State private var randNum2=1
    @State private var score1=0
    @State private var score2=0
    var body: some View {
        ZStack{
            Image("background")
                .resizable()
                .edgesIgnoringSafeArea(.all)
            
            VStack {
                Spacer()
                Image("logo")
 
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!