SwiftUI知识点(二)

Animation

import SwiftUI

struct AnimationBootcamp: View {
    
    @State var isAnimation: Bool = false
    
    var body: some View {
        VStack{
            Button("Button"){
                withAnimation(
                    Animation
                        .default
                        //重复
                        //autoreverses: true:A-B-A-B
                        //false: A-B,A-B
                        .repeatForever(autoreverses: true)){
                    isAnimation.toggle()
                }
                
            }
            
            Spacer()
            
            Rectangle()
                .fill(isAnimation ? .green : .red)
                .cornerRadius(isAnimation ? 10 : 50)
                .frame(
                    width: isAnimation ? 300 : 100,
                    height: isAnimation ? 300 : 100)
                //移动距离
                .offset(y: isAnimation ? 200 : 0)
                //转动角度
                .rotationEffect(Angle(degrees: isAnimation ? 360 : 0))
            
            
            Spacer()
        }
        
        
        
    }
}

#Preview {
    AnimationBootcamp()
}

在这里插入图片描述

Transition

import SwiftUI

struct TransitionBootcamp: View {
    
    @State var isShowView: Bool = true
    
    var body: some View {
        ZStack(alignment: .bottom) {
            VStack {
                Button("Button") {
                    //等价于:isShowView = !isShowView
                    isShowView.toggle()
                }
                Spacer()
            }
            
            if isShowView {
                RoundedRectangle(cornerRadius: 30)
                    .frame(height: UIScreen.main.bounds.height * 0.5)
                    //从什么地方进,从什么地方出
                    .transition(.asymmetric(
                        insertion: .move(edge: .leading),
                        removal: .move(edge: .bottom)))
                    ///动画:慢进慢出
                    .animation(.easeInOut)
            }
        }
        
        ///忽略底部的间隙
        .edgesIgnoringSafeArea(.bottom)
    }
}

#Preview {
    TransitionBootcamp()
}

在这里插入图片描述

Sheets

import SwiftUI

struct SheetsBootcamp: View {
    
    @State var isPresented: Bool = false
    
    var body: some View {
        
        ZStack {
            ///绿色背景
            Color.green
                .edgesIgnoringSafeArea(.all)//全部填充满
            
            Button(action: {
                isPresented.toggle()
            }, label: {
                Text("pop另外一个view")
                    .foregroundColor(.green)
                    .font(.headline)
                    .padding(20)
                    .background(Color.white.cornerRadius(5.0))
            })
            
            ///pop出下一个view
            .sheet(isPresented: $isPresented, content: {
                NextSheetsBootcamp()
            })
            
            ///全屏出现
            .fullScreenCover(isPresented: $isPresented, content: {
                NextSheetsBootcamp()
            })
            
            ///方法二:Transition
            ZStack{
                if isPresented {
                    NextSheetsBootcamp(isPresented: $isPresented)
                        .padding(.top, 100)
                        .transition(.move(edge: .bottom))
                        .animation(.spring)
                }
            }
            //设置了视图的堆叠顺序(不加这个,也有动画效果)
            .zIndex(2)
            
            ///方法三:Animation
            NextSheetsBootcamp(isPresented: $isPresented)
                .padding(.top, 100)
                .offset(y: isPresented ? 0 : UIScreen.main.bounds.height)
                .animation(.spring)
        }
    }
}

///出现的新View
struct NextSheetsBootcamp: View {
    ///固定写法
    @Environment(\.presentationMode) var presentationMode
    
    var body: some View {
        ///关闭按钮在左上角
        ZStack(alignment: .topLeading) {
            Color.red
                .edgesIgnoringSafeArea(.all)
            
            Button(action: {
                ///点击按钮,关闭popView
                presentationMode.wrappedValue.dismiss()
                
                ///方法二、三的关闭
                isPresented.toggle()
            }, label: {
                Image(systemName: "xmark")
                    .foregroundColor(.white)
                    .font(.largeTitle)
                    .padding(20)
            })
        }
    }
}


#Preview {
    SheetsBootcamp()
}

在这里插入图片描述

NavigationView

import SwiftUI

struct NavigationViewBootcamp: View {
    var body: some View {
        NavigationView{
            ScrollView {
                
                ///需要点击跳转的,加上NavigationLink
                NavigationLink("Hello") {
                    //下一个View的内容
                    SecondNavigationViewBootcamp()
                }
                
                Text("Hello,navigationView1")
                Text("Hello,navigationView2")
                Text("Hello,navigationView3")
                Text("Hello,navigationView4")
            }
            .navigationTitle("Title")
            .navigationBarTitleDisplayMode(.large)
//            .toolbar(.hidden)
            
            //leading:左边items
            //trailing:右边items
            .navigationBarItems(leading:
                                    HStack{
                                    Image(systemName: "person.fill")
                                    Image(systemName: "flame.fill")
                                },
                                trailing: NavigationLink(destination: {
                                    SecondNavigationViewBootcamp()
                                }, label: {
                                    Image(systemName: "gear")
                                }))
            
        }
    }
}

struct SecondNavigationViewBootcamp: View {
    var body: some View {
        ZStack{
            Color.green.ignoresSafeArea(.all)
                .navigationTitle("navigationTitle2")
            
            NavigationLink("Click here", destination: Text("第三个Nav内容"))
        }
    }
}

#Preview {
    NavigationViewBootcamp()
}

在这里插入图片描述

List

import SwiftUI

struct ListBootcamp: View {
    @State var fruits: [String] = [
        "apple", "banana", "orange", "peach"
    ]
    
    var body: some View {
        NavigationView {
            List{
                Section {
                    ///for循环
                    ///id: \.self,以自己为index
                    ForEach(0..<fruits.count, id: \.self){ index in
                        Text(fruits[index])
                            .font(.caption)//设置cell的样式
                            .foregroundStyle(.white)
                            .padding(.vertical)
                    }
                    ///左滑删除
                    .onDelete(perform: { indexSet in
                        fruits.remove(atOffsets: indexSet)
                    })
                    ///section的背景颜色
                    .listRowBackground(Color.blue)
                } header: {
                    HStack{
                        Text("Fruits1")
                        Image(systemName: "flame.fill")
                    }
                    //设置section的样式
                    .font(.largeTitle)
                    .foregroundColor(.orange)
                }
                
                Text("----------")
                
                Section {
                    ForEach(fruits, id: \.self){ fruit in
                        Text(fruit)
                    }
                    
                    ///没有实现,不能正常保存
                    .onMove(perform: { indices, newOffset in
                        fruits.move(fromOffsets: indices, toOffset: newOffset)
                    })
                } header: {
                    Text("Fruits2")
                }
                
            }
            ///样式,类似group\plain
            //.listStyle(.insetGrouped)
            .accentColor(.purple)//没起作用
            .navigationTitle("Navigation Title")
            .navigationBarItems(
                leading: EditButton(),
                trailing: Button("Add", action: {
                fruits.append("watermelon")
            }))
        }
        .accentColor(.red)
    }
}

#Preview {
    ListBootcamp()
}

在这里插入图片描述

Alert

import SwiftUI

struct AlertBootcamp: View {
    @State var showAlert: Bool = false
    @State var backgroundColor: Color = Color.yellow
    var body: some View {
        ZStack {
            backgroundColor.edgesIgnoringSafeArea(.all)
            
            Button("Click here"){
                showAlert.toggle()
            }
            
            .alert(isPresented: $showAlert, content: {
    //            Alert(title: Text("There was an error!"))
                
                getAlert()
            })
        }
    }
    
    func getAlert() -> Alert {
        return Alert(title: Text("There was an error!"),
                     message: Text("This is a message"),
                     primaryButton: .destructive(Text("red color"), action: {
                       backgroundColor = .red
                     }),
                     secondaryButton: .default(Text("cancel")))
    }
    
}

#Preview {
    AlertBootcamp()
}

在这里插入图片描述

Actionsheet

import SwiftUI

struct ActionsheetBootcamp: View {
    @State var isPresented: Bool = false
    @State var actionSheetOption: ActionSheetOptions = .isOtherPost
    
    enum ActionSheetOptions {
        case isMyPost
        case isOtherPost
    }
    
    var body: some View {
        
        VStack {
            HStack {
                Circle()
                    .frame(width: 30, height: 30)
                Text("userNane")
                Spacer()
                Button(action: {
                    actionSheetOption = .isMyPost
                    isPresented.toggle()
                }, label: {
                    Image(systemName: "ellipsis")
                })
            }
            Rectangle()
                .frame(width: 370, height: 300)
                .cornerRadius(10)
        }
        .padding(10)
        
        .actionSheet(isPresented: $isPresented, content: {
            
            let button1: ActionSheet.Button = .cancel(Text("取消"))
            let button2: ActionSheet.Button = .destructive(Text("删除"))
            let button3: ActionSheet.Button = .default(Text("默认"))
            
            
            var otherButtonsArray = [button1]
            var myButtonsArray = [button1, button2, button3]
            
            return ActionSheet(title: Text("标题"),
                        message: Text("消息"),
                               buttons: actionSheetOption == .isMyPost ? myButtonsArray : otherButtonsArray
            )
        })
    }
}

#Preview {
    ActionsheetBootcamp()
}

在这里插入图片描述

ContextMenu

import SwiftUI

struct ContextMenuBootcamp: View {
    
    @State var backgroundColor: Color = Color.blue
    
    var body: some View {
        VStack(alignment: .leading){
            Image(systemName: "house")
                .font(.largeTitle)
            
            Text("SwiftUI Thinking")
                .font(.title2)
            
            Text("How to use Context Menu")
                .font(.title3)
        }
        .foregroundStyle(.white)
        .padding(30)
        .background(backgroundColor)
        .cornerRadius(30)
        ///长按,而不是点按
        .contextMenu(menuItems: {
            Button(action: {
                backgroundColor = Color.red
            }, label: {
                Label("标题1", systemImage: "flame.fill")
            })
            Button(action: {
                backgroundColor = Color.green
            }, label: {
                Text("标题2")
            })
            Button(action: {
                backgroundColor = Color.yellow
            }, label: {
                Text("标题2")
                Image(systemName: "heart.fill")
            })
        })
    }
}

#Preview {
    ContextMenuBootcamp()
}

在这里插入图片描述

TextField

import SwiftUI

struct TextfieldBootcamp: View {
    @State var textFieldString: String = ""
    @State var stringArray: [String] = []
    
    var body: some View {
        NavigationView{
            VStack(alignment: .leading){
                TextField("请输入文字", text: $textFieldString)
                    .padding()
                    .background(.gray.opacity(0.5))
                    .foregroundStyle(.red)
                    .cornerRadius(5.0)
                    .font(.headline)
                
                Button("Save".uppercased()) {
                    if isRight() {
                        saveText()
                    }
                }
                .padding()
                .frame(maxWidth: .infinity)
                .background(isRight() ? .blue : .gray)
                .foregroundStyle(.white)
                .cornerRadius(5.0)
                .disabled(!isRight())
                
                ///由于是绑定了stringArray,
                ///stringArray.append(textFieldString)的时候,stringArray值发生改变,此时,调用这个方法
                ForEach(stringArray, id:\.self) { item in
                    Text(item)
                }
                
                Spacer()
            }
            .padding()
            .navigationTitle("标题")
        }
    }
    
    func saveText(){
        stringArray.append(textFieldString)
        textFieldString = ""
    }
    
    func isRight() -> Bool{
        if textFieldString.count >= 3 {
            return true
        }
        return false
    }
}

#Preview {
    TextfieldBootcamp()
}

在这里插入图片描述

这块有点不好理解的地方
比如我先输入123,点击save,则有一个Text(123)
再输入456,点击save,此时,for循环变量,拿出数组的值,而数组有两个元素[“123”, “456”]
应该输出两个Text,即Text(123),Text(456),加上之前的Text(123),此时有:Text(123),Text(123),Text(456)
而实际上,只有Text(123),Text(456)
这是因为:swiftUI的视图是声明式的,在状态改变的时候,重新渲染视图,渲染的内容只有新的部分,即Text(456)

当你在一个数组中添加新的元素时,SwiftUI 会进行视图差异计算,只更新那些真正改变的部分:

  • 已存在的元素,不会被删除;视图保持不变,以实现高效复用。
  • 新增的元素,会被 SwiftUI 生成新的视图,并插入到视图树中。

TextEditor


import SwiftUI

struct TextEditorBootcamp: View {
    @State var textEditorString: String = "占位字"
    @State var saveTextString: String = ""
    var body: some View {
        NavigationView{
            VStack{
                TextEditor(text: $textEditorString)
                    ///使用这个设置文本框的背景颜色比较好
                    .overlay(
                        Color.gray.opacity(0.3).cornerRadius(10)
                    )
                    .cornerRadius(10)
                    .padding(10)
                    .font(.largeTitle)
                    .frame(height: 300)
                    .foregroundStyle(.red)
                    //这个背景颜色,会将字体一起添加上透明度
//                    .colorMultiply(.gray.opacity(0.3))
                    //这个颜色,区域不是文字的背景色
//                    .background(.gray.opacity(0.3))
                    
                Button(action: {
                    saveTextString = textEditorString
                }, label: {
                    Text("保存")
                        //先设置frame才生效
                        .frame(maxWidth: .infinity, minHeight: 50)
                        .background(.blue)
                        .foregroundStyle(.white)
                        .cornerRadius(10)
                        .padding(10)
                        //这里设置,按钮大小是对的,但是颜色值等不生效,因为是根据顺序渲染的
//                        .frame(maxWidth: .infinity)
                })
                
                Text(saveTextString)
                
                Spacer()
            }
            .navigationTitle("导航标题")
        }
    }
}

#Preview {
    TextEditorBootcamp()
}

在这里插入图片描述

Toggle

import SwiftUI

struct ToggleBootcamp: View {
    
    @State var toggleState: Bool = false
    
    var body: some View {
        
        VStack {
            
            Text("按钮状态:\(toggleState)")
                .font(.largeTitle)
            
            Toggle(isOn: $toggleState, label: {
                Text("改变按钮状态:")
            })
            .toggleStyle(SwitchToggleStyle(tint: .purple))
            .padding(.horizontal, 100)
            
            Spacer()
        }
    }
}

#Preview {
    ToggleBootcamp()
}

在这里插入图片描述

Picker

import SwiftUI

struct PickerBootcamp: View {
    
    @State var selection1: String = ""
    @State var selection2: String = ""
    @State var selection3: String = ""
    
    let filterOptions: [String] = [
        "Most Recent", "Most Popular", "Most Linked"
    ]
    
    //只对segment样式的picker起作用
    init(){
        UISegmentedControl.appearance().selectedSegmentTintColor = UIColor.red
        
        let attrubutes: [NSAttributedString.Key : Any] = [
            .foregroundColor: UIColor.white
        ]
        UISegmentedControl.appearance().setTitleTextAttributes(attrubutes, for: .selected)
    }
    
    var body: some View {
        NavigationView{
            VStack{
                Text("pick1选中的是:" + selection1)
                Picker(selection: $selection1) {
                    ForEach(18...100, id: \.self) { item in
                        //tag不能少,因为text只是显示,tag才是给上面selection使用的
                        Text("\(item)").tag("\(item)")
                    }
                } label: {
                    Text("Picker")
                }
                //样式
                .pickerStyle(.wheel)
                
                //分割线
                Divider()
                
                Text("pick2选中的是:" + selection2)
                Picker(selection: $selection2) {
                    ForEach(filterOptions, id: \.self) { item in
                        HStack{
                            Text("\(item)")
                            Image(systemName: "heart")
                        }
                        .tag(item)
                    }
                } label: {
                    Text("Picker2")
                        .font(.headline)
                        .foregroundStyle(.white)
                        .padding()
                        .backgroundStyle(Color.blue)
                }
                .pickerStyle(.menu)
                
                Spacer()
                //分割线
                Divider()
                Spacer()
                
                Text("pick3选中的是:" + selection3)
                Picker(selection: $selection3) {
                    ForEach(filterOptions, id: \.self) { item in
                        //tag不能少,因为text只是显示,tag才是给上面selection使用的
                        Text("\(item)").tag(item)
                    }
                } label: {
                    Text("Picker3")
                }
                .pickerStyle(.segmented)
                
                
                Spacer()

            }
            .navigationTitle("导航栏")
        }
        
        
    }
}

#Preview {
    PickerBootcamp()
}

在这里插入图片描述

ColorPicker

import SwiftUI

struct ColorPickerBootcamp: View {
    @State var backgroundColor: Color = .green
    
    var body: some View {
        ZStack{
            backgroundColor.ignoresSafeArea(.all)
            
            ColorPicker("颜色选择器", selection: $backgroundColor, supportsOpacity: true)
                .padding()
                .background(.black)
                .foregroundColor(.white)
                .cornerRadius(10)
                .padding(30)
        }
    }
}

#Preview {
    ColorPickerBootcamp()
}

在这里插入图片描述

DatePicker


import SwiftUI

struct DatePickerBootcamp: View {
    @State var selectedDate: Date = Date()
    
    let startingDate: Date = Calendar.current.date(from: DateComponents(year: 2018)) ?? Date()
    let endingDate: Date = Calendar.current.date(from: DateComponents(year: 2038)) ?? Date()
    
    //设置输出的日期格式
    var dateFormatter: DateFormatter {
        let formatter = DateFormatter()
        formatter.dateStyle = .short
        formatter.timeStyle = .short
        return formatter
    }
    
    var body: some View {
        
        VStack{
            HStack{
                Text("选中的日期是:")
                Text(dateFormatter.string(from: selectedDate))
                    .foregroundStyle(.green)
            }
            
            
            DatePicker("日期选择器1", selection: $selectedDate)
                .datePickerStyle(CompactDatePickerStyle())//默认CompactDatePickerStyle
            
            //displayedComponents可以具体要日、时、分?
            DatePicker("日期选择器2", selection: $selectedDate, displayedComponents: [.date, .hourAndMinute])
                .datePickerStyle(GraphicalDatePickerStyle())//展开样式
            
            //in 可以设置时间的起止日期
            DatePicker("日期选择3", selection: $selectedDate, in: startingDate...endingDate, displayedComponents: [.date])
                .datePickerStyle(WheelDatePickerStyle())
            
        }
        .accentColor(Color.red)
        
    }
}

#Preview {
    DatePickerBootcamp()
}

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/785079.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

[图解]SysML和EA建模住宅安全系统-13-时间图

1 00:00:00,480 --> 00:00:02,280 首先&#xff0c;我们来看&#xff0c;图画在哪里 2 00:00:02,290 --> 00:00:04,380 这个图 3 00:00:04,390 --> 00:00:06,180 你看&#xff0c;它是描述&#xff0c;刚才讲的 4 00:00:06,190 --> 00:00:09,010 描述这个活动 …

STM32学习历程(day5)

EXTI外部中断 中断 中断就是在主程序运行过程中 出现了特定的中断触发条件&#xff08;中断源&#xff09;&#xff0c;CPU会暂停当前的程序&#xff0c;去处理中断程序 处理完会返回被暂停的位置 继续运行原来的程序。 中断优先级 当有多个中断源同时申请中断时 CPU会根据…

设计模式之职责链模式(Chain of Responsibility Pattern)

1.概念 职责链模式&#xff08;Chain of Responsibility Pattern&#xff09;&#xff1a;避免将请求发送者与接收者耦合在一起&#xff0c;让多个对象都有机会接收请求&#xff0c;将这些对象连接成一条链&#xff0c;并且沿着这条链传递请求&#xff0c;直到有对象处理它为止…

单例模式(大话设计模式)C/C++版本

单例模式 C 饿汉 /* HM hungry man 饿汉 */ #include <iostream> using namespace std; class Singleton { private:Singleton() { cout << "单例对象创建&#xff01;" << endl; };Singleton(const Singleton &);Singleton &operator(c…

【ARMv8/v9 GIC 系列 2.4 -- GIC SGI 和 PPI 中断的启用配置】

请阅读【ARM GICv3/v4 实战学习 】 文章目录 GIC SGI 和 PPI 中断的使能配置GICR_ISENABLER0 操作使用举例SummaryGIC SGI 和 PPI 中断的使能配置 GICR_ISENABLER0寄存器(中断设置-使能寄存器0)用于启用相应的SGI(软件生成中断)或PPI(专用外设中断)向CPU接口的转发。每个…

Android多开应用软件系统设计

设计一个支持Android多开应用的软件系统&#xff0c;主要涉及到以下几个关键技术点和设计考虑&#xff1a; 1. 虚拟化技术 容器技术&#xff1a;与传统的虚拟机不同&#xff0c;可以采用更轻量级的容器技术&#xff0c;为每个应用实例创建独立的运行环境。这包括分配独立的用…

atcoder 357 F Two Sequence Queries (线段树板子)

题目&#xff1a; 分析&#xff1a; 线段树 代码&#xff1a; // Problem: F - Two Sequence Queries // Contest: AtCoder - SuntoryProgrammingContest2024&#xff08;AtCoder Beginner Contest 357&#xff09; // URL: https://atcoder.jp/contests/abc357/tasks/abc357_…

AI实时免费在线图片工具6:以图生相似图

1、以图生图&#xff0c;生成相似图 https://huggingface.co/spaces/diffusers/unofficial-SDXL-Turbo-i2i-t2i 间接实现&#xff1a;可以是图片先提取描述&#xff0c;再通过描述再去生成新图片 https://huggingface.co/spaces/gokaygokay/KolorsPlusPlus

JAVA基础-----128陷阱

一、何为128陷阱 Java中Integer类型在使用比较时的特殊行为------128陷阱&#xff0c;解释了当数值在-128到127范围内&#xff0c;由于valueOf方法的缓存机制导致地址相同&#xff0c;比较为真&#xff1b;超出这个范围则新分配内存&#xff0c;地址不同&#xff0c;比较为假。…

动态数据库设计

动态数据库设计是一种灵活的方法&#xff0c;用于构建能够适应不断变化的数据需求的数据库结构。它强调在不频繁修改数据库表结构的前提下&#xff0c;有效管理和存储多样化的数据。以下是实现动态数据库设计的一些关键技术点和策略&#xff1a; 实体-属性-值&#xff08;EAV&a…

安卓项目中so库选择

接上篇Android中常见SDK类型区别-CSDN博客 一些重要的加密算法或者核心协议一般都在C中编写&#xff0c;然后给java调用。这样可以避免反编译后查看到应用的源码。此时就需要了解一下NDK中的ABI&#xff08;Application Binary Interface的缩写&#xff0c;也就是应用二进制接…

代谢组数据分析一:代谢组数据准备

介绍 该数据集是来自于Zeybel 2022年发布的文章_Multiomics Analysis Reveals the Impact of Microbiota on Host Metabolism in Hepatic Steatosis_ [@zeybel2022multiomics],它包含了多种组学数据,如: 微生物组(粪便和口腔) 宿主人体学指标 宿主临床学指标 宿主血浆代谢…

8.8.8.8 IP地址的作用

在跟着韦东山老师的学习手册中看见了关于8.8.8.8 IP用于检测网络状态&#xff0c;然后搜索了关于此IP的相关作用如下&#xff1a; 公共DNS服务&#xff1a;8.8.8.8是Google提供的两个公共DNS服务器地址之一&#xff08;另一个是8.8.4.4&#xff09;。DNS&#xff08;域名系统&a…

GNN Algorithms(9): LLM Prompts--p-tuning、LoRA

目录 1. prompt-tuning background 2. Prompt Tuning 模型介绍 2.1 2021 prefix-tuning 2.2 2021 P-tuning v1 2.3 2021 Parameter-efficient prompt tuning (PET) 2.4 2022 P-tuning v2 2.5 2019 Adapter ​2.6 2021 LoRA (Low-Rank Adaptation) 2.7 2024 DoRA (…

LT8644EX 国产芯片 低功耗 数字交叉点开关 用于光纤网络交换 数字视频 数据存储网络

2.一般说明 LT8644EX是一个16x16数字交叉点交换机:具有16个差分CML兼容输入端和16个差动CML输出端。该LT8644EX是优化非归零(NRZ)与高达每端口6 Gbps的数据速率信令。每个端口提供可编程水平的输入均衡和可编程输出摆幅。tell 18171547226,该LT8644EX支持通过串行控制接口的独立…

尚品汇-(十五)

&#xff08;1&#xff09;快速入门 SpringBoot形式创建 Maven形式创建&#xff1a; 加入依赖&#xff1a; 创建启动类&#xff1a; 设置头文件 就想Jsp的<%Page %>一样 &#xff0c;Thymeleaf的也要引入标签规范。不加这个虽然不影响程序运行&#xff0c;但是你的idea…

Open-Sora1.2环境搭建推理测试

引子 前阵子写了一篇Open-Sora1.0环境搭建&推理测试&#xff08;Open-Sora1.0环境搭建&推理测试_自己搭建sora服务-CSDN博客&#xff0c;感兴趣的童鞋&#xff0c;请移步&#xff09;。Open-Sora1.1发布的时候&#xff0c;撇了一眼新闻。后面一转头&#xff0c;忘记这…

Flink 提交作业的方式

首先我进行了flink单机部署&#xff0c;个人建议不管是学习还是开发尽量不使用 然后开始了flink自带集群部署&#xff0c;部署在三台服务器上&#xff0c;资源管理由flink集群自己管理&#xff0c;然后为了解决集群的单点故障问题&#xff0c;使用zookeeper监听事件&#xff0…

如何做一个透明度渐现且向上位移逐行出现的文字效果

前言 在这个夜黑风高的夜晚&#xff0c;你的眼睛已经开始有些疲惫。你的手指在键盘上轻轻地敲击着&#xff0c;仿佛在弹奏一首无声的夜曲。你的思绪在代码的海洋中飘荡&#xff0c;寻找着最后一行需要完成的代码。就在这时&#xff0c;你的老板走了过来&#xff0c;他的脸上带…

7/8 复盘

后端数据传输&#xff1f; 后端代码的耦合&#xff1a;打点调用、方法调用、接口、继承。 Dao、Service、servlet(controller)各层的作用&#xff1f; Dao负责与数据库交互&#xff0c;执行SQL语句&#xff0c;例如简单的增删改查等等。&#xff08;要创建对应的接口和实现类…