当前位置: 首页 > news >正文

网站查询平台官网百度一下你就知道下载安装

网站查询平台官网,百度一下你就知道下载安装,东莞企业名录网,动态网站开发基础教程期末习题1. 创建启动画板,LaunchScreen.storyboard 添加组件如图: 2. 项目中设置只支持竖屏,添加启动画板,如图: 3. 创建启动画面动画视图,LaunchView.swift import SwiftUI/// 启动视图 struct LaunchView: View {/// 字符串转换为字符串…

1. 创建启动画板,LaunchScreen.storyboard 添加组件如图:

2. 项目中设置只支持竖屏,添加启动画板,如图:

3. 创建启动画面动画视图,LaunchView.swift

import SwiftUI/// 启动视图
struct LaunchView: View {/// 字符串转换为字符串数组,字符串中包含单个字母组成@State private var loadingText: [String] = "Loading your portfolio...".map { String($0) }/// 是否显示文字@State private var showLoadingText: Bool = false/// 计时器private let timer = Timer.publish(every: 0.1, on: .main, in: .common).autoconnect()/// 计数@State private var counter: Int = 0/// 循环次数@State private var loops: Int = 0/// 是否显示启动 View@Binding var showLaunchView: Boolvar body: some View {ZStack {// 背景颜色Color.launch.background.ignoresSafeArea()// 图标Image("logo-transparent").resizable().frame(width: 100, height: 100)// 文字ZStack {if showLoadingText {HStack(spacing: 0) {ForEach(loadingText.indices, id: \.self) { index inText(loadingText[index]).font(.headline).fontWeight(.heavy).foregroundColor(Color.launch.accent).offset(y: counter == index ? -5 : 0)}}.transition(AnyTransition.scale.animation(.easeIn))}}.offset(y: 70)}.onAppear {showLoadingText.toggle()}.onReceive(timer) { _ in// 添加弹簧动画withAnimation(.spring()) {let lastIndex = loadingText.count - 1if counter == lastIndex {counter = 0// 循环多少次loops += 1// 检查次数if loops >= 2 {showLaunchView = false}}else{counter += 1}}}}
}struct LaunchView_Previews: PreviewProvider {static var previews: some View {LaunchView(showLaunchView: .constant(true))}
}

4. 启动结构体中添加版本适配、启动页、主页,SwiftfulCryptoApp.swift

import SwiftUI@main
struct SwiftfulCryptoApp: App {/// 主 ViewModel@StateObject private var viewModel = HomeViewModel()/// 是否显示启动 View@State private var showLaunchView: Bool = trueinit() {// 修改导航栏中标题的颜色, 适配 iOS 15 导航栏背景自动更改为默认颜色if #available(iOS 15, *) {let barAppearance = UINavigationBarAppearance()barAppearance.configureWithOpaqueBackground()  // 重置背景和阴影颜色barAppearance.titleTextAttributes = [.foregroundColor: UIColor(Color.theme.accent) ]barAppearance.largeTitleTextAttributes = [.foregroundColor: UIColor(Color.theme.accent)]barAppearance.backgroundColor = UIColor(Color.theme.background)  // 设置导航栏背景色// let buttonAppearance = UIBarButtonItemAppearance()// buttonAppearance.normal.titleTextAttributes = [//    .foregroundColor: UIColor(Color.theme.accent)// ]//appBarAppearance.buttonAppearance = buttonAppearanceUINavigationBar.appearance().standardAppearance = barAppearance // 带scroll滑动的页面UINavigationBar.appearance().scrollEdgeAppearance = barAppearance // 常规页面UINavigationBar.appearance().compactAppearance = barAppearance}else{UINavigationBar.appearance().largeTitleTextAttributes = [.foregroundColor: UIColor(Color.theme.accent)]UINavigationBar.appearance().titleTextAttributes = [.foregroundColor: UIColor(Color.theme.accent)]UINavigationBar.appearance().backgroundColor = UIColor(Color.theme.background)UINavigationBar.appearance().tintColor = UIColor(Color.theme.accent) //前景色,按钮颜色//UINavigationBar.appearance().barTintColor = UIColor(Color.theme.background) //背景色,导航条背景色// 更改表格背景颜色UITableView.appearance().backgroundColor = .clear}}var body: some Scene {WindowGroup {ZStack {NavigationView {HomeView()//.navigationBarHidden(true)}// 适配 iPad 导航栏.navigationViewStyle(.stack)// 环境对象中添加 view model,便于每个 View 都能够去访问.environmentObject(viewModel).accentColor(Color.theme.accent)// 防止 Z 堆栈跳转时产生混乱问题ZStack {// 是否显示启动 Viewif showLaunchView {LaunchView(showLaunchView: $showLaunchView)//.transition(.move(edge: .leading))// transition: 过渡动画 .scale(scale: 0).transition(.move(edge: .leading))}}.zIndex(2.0)}}}
}

5. 效果图:

http://www.hkea.cn/news/424560/

相关文章:

  • 仿制单页面网站多少钱免费制作网站app
  • 商城网站制作网站长尾词挖掘工具
  • 夹克定制公司trinseo公司
  • 四川智能网站建设制作网站链接分析工具
  • 制作销售网站有哪些宁波网络营销推广咨询报价
  • 佛山做外贸网站服务新闻发稿平台
  • 做网站前怎么写文档域名收录
  • 中信建设有限责任公司钟宁关键词优化的方法有哪些
  • 建站之星平台优化推广网站排名
  • wordpress 网盘 插件郑州seo外包阿亮
  • 怎样建设网站首页广告营销平台
  • wordpress调起淘宝app什么叫做seo
  • 嘉兴做网站优化的公司网站维护公司
  • css层叠样式会不会影响打开网站的速度百度免费下载安装百度
  • 网站模板制作流程nba交易最新消息汇总
  • 近的网站在线客服系统网络优化工程师前景如何
  • 网站制作职业google入口
  • 广州网站 制作信科便宜网络营销软文范例500
  • 网站建设公开课长沙网站推广和优化
  • 建设网站的需求分析俄罗斯搜索引擎yandex推广入口
  • 可以做英文纵横字谜的网站搜狗网站收录入口
  • web前端开发是不是做网站百家号关键词排名优化
  • 夸克看网站要钱吗电商网站seo优化
  • 自己做网站排版138ip查询网域名解析
  • 东莞做网站 南城石佳2023网站推广入口
  • 广东省省建设厅网站郴州网站建设网络推广平台
  • 校园网站推广方案怎么做应用商店优化
  • 巩义网站建设网络营销公司是做什么的
  • 做网站基本教程一站式营销平台
  • 杭州模板网站建设电脑培训网上培训班