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

宜宾建设局网站热狗seo顾问

宜宾建设局网站,热狗seo顾问,学编程去哪里学比较好,慈城旅游网站建设策划书SwiftUI模块系列 - 已更新60篇 SwiftUI项目 - 已更新5个项目 往期Demo源码下载 技术:SwiftUI、SwiftUI4.0、Instagram、Firebase 运行环境: SwiftUI4.0 Xcode14 MacOS12.6 iPhone Simulator iPhone 14 Pro Max SwiftUI基于Firebase搭建一个类似InstagramApp 2/7部分-搭建Tab… SwiftUI模块系列 - 已更新60篇 SwiftUI项目 - 已更新5个项目 往期Demo源码下载 技术:SwiftUI、SwiftUI4.0、Instagram、Firebase 运行环境: SwiftUI4.0 Xcode14 MacOS12.6 iPhone Simulator iPhone 14 Pro Max SwiftUI基于Firebase搭建一个类似InstagramApp 2/7部分-搭建TabBar 概述详细一、运行效果二、项目结构图三、程序实现 - 过程1.创建一个项目命名为 SpotifyResponvieUI1.1.引入资源文件和颜色2. 创建一个虚拟文件New Group 命名为 View3. 创建一个虚拟文件New Group 命名为 Model4. 创建一个文件New File 选择SwiftUI View类型 命名为Album 并且继承Identifiable5. 创建一个文件New File 选择SwiftUI View类型 命名为Home6. 创建一个文件New File 选择SwiftUI View类型 命名为OffsetModifier CodeContentView - 主窗口Home - 主页OffsetModifier - 主要是监听ScrollView的滚动Album - 模型 概述 使用SwiftUI基于Firebase搭建一个类似InstagramApp 2/7部分-搭建TabBar - 效果 详细 一、运行效果 二、项目结构图 三、程序实现 - 过程 思路: 1.创建头部模块 进行测试上下滚动拥有放大缩小效果 2.搭建分类模块 固定在头部下面 3.搭建列表模块 4.监听滚动偏移的操作 1.创建一个项目命名为 SpotifyResponvieUI 1.1.引入资源文件和颜色 颜色 BG #281A1A Green #4DD037 随机图片9张 个人大图背景1张 logo1张 2. 创建一个虚拟文件New Group 命名为 View 3. 创建一个虚拟文件New Group 命名为 Model 4. 创建一个文件New File 选择SwiftUI View类型 命名为Album 并且继承Identifiable 5. 创建一个文件New File 选择SwiftUI View类型 命名为Home 主要是: 6. 创建一个文件New File 选择SwiftUI View类型 命名为OffsetModifier Code ContentView - 主窗口 主要是展示主窗口Home和设置暗黑模式 import SwiftUIstruct ContentView: View {var body: some View {Home()// 永远是黑暗模式.preferredColorScheme(.dark)}}struct ContentView_Previews: PreviewProvider {static var previews: some View {ContentView()} }Home - 主页 思路 主要就是展示大图背景 固定的分类 列表模块 // // Home.swift // SpotifyResponvieUI (iOS) // // Created by lyh on 2022/8/23. //import SwiftUIstruct Home: View {State var currentType: String Popular// 光滑滑动效果Namespace var animationState var _albums: [Album] albums// x,yState var headerOffsets: (CGFloat,CGFloat) (0,0)var body: some View {ScrollView(.vertical, showsIndicators: false) {VStack(spacing: 0){HeaderView()// 带内容的固定标题LazyVStack(pinnedViews: [.sectionHeaders]) {Section {SongList()} header: {PinnedHeaderView().background(Color.black).offset(y: headerOffsets.1 0 ? 0 : -headerOffsets.1 / 8).modifier(OffsetModifier(offset: $headerOffsets.0, returnFromStart: false)).modifier(OffsetModifier(offset: $headerOffsets.1))}}}}.overlay(content: {Rectangle().fill(.black).frame(height: 50).frame(maxHeight: .infinity,alignment: .top).opacity(headerOffsets.0 5 ? 1 : 0)}).coordinateSpace(name: SCROLL).ignoresSafeArea(.container, edges: .vertical)}// 固定的内容ViewBuilderfunc SongList()-some View{VStack(spacing: 25){ForEach($_albums){$album inHStack(spacing: 12){Text(#\(getIndex(album: album) 1)).fontWeight(.semibold).foregroundColor(.gray)Image(album.albumImage).resizable().aspectRatio(contentMode: .fill).frame(width: 55, height: 55).clipShape(RoundedRectangle(cornerRadius: 10, style: .continuous))VStack(alignment: .leading, spacing: 8) {Text(album.albumName).fontWeight(.semibold)Label {Text(65,587,909)} icon: {Image(systemName: beats.headphones).foregroundColor(.white)}.foregroundColor(.gray).font(.caption)}.frame(maxWidth: .infinity,alignment: .leading)Button {album.isLiked.toggle()} label: {Image(systemName: album.isLiked ? suit.heart.fill : suit.heart).font(.title3).foregroundColor(album.isLiked ? Color(Green) : .white)}Button {} label: {Image(systemName: ellipsis).font(.title3).foregroundColor(.white)}}}}.padding().padding(.top,25).padding(.bottom,150)}func getIndex(album: Album)-Int{return _albums.firstIndex { currentAlbum inreturn album.id currentAlbum.id} ?? 0}// 头部视图ViewBuilderfunc HeaderView()-some View{GeometryReader{proxy inlet minY proxy.frame(in: .named(SCROLL)).minYlet size proxy.sizelet height (size.height minY)Image(Ariana).resizable().aspectRatio(contentMode: .fill).frame(width: size.width,height: height 0 ? height : 0,alignment: .top).overlay(content: {ZStack(alignment: .bottom) {// 调暗文本内容LinearGradient(colors: [.clear,.black.opacity(0.8)], startPoint: .top, endPoint: .bottom)VStack(alignment: .leading, spacing: 12) {Text(宇夜iOS).font(.callout).foregroundColor(.gray)HStack(alignment: .bottom, spacing: 10) {Text(Ariana Grande).font(.title.bold())Image(systemName: checkmark.seal.fill).foregroundColor(.blue).background{Circle().fill(.white).padding(3)}}Label {Text(Monthly Listeners).fontWeight(.semibold).foregroundColor(.white.opacity(0.7))} icon: {Text(62,354,659).fontWeight(.semibold)}.font(.caption)}.padding(.horizontal).padding(.bottom,25).frame(maxWidth: .infinity,alignment: .leading)}}).cornerRadius(15).offset(y: -minY)}.frame(height: 250)}// 固定在头部ViewBuilderfunc PinnedHeaderView()-some View{let types: [String] [Popular,Albums,Songs,Fans also like,About]ScrollView(.horizontal, showsIndicators: false) {HStack(spacing: 25){ForEach(types,id: \.self){type inVStack(spacing: 12){Text(type).fontWeight(.semibold).foregroundColor(currentType type ? .white : .gray)ZStack{if currentType type{RoundedRectangle(cornerRadius: 4, style: .continuous).fill(.white).matchedGeometryEffect(id: TAB, in: animation)}else{RoundedRectangle(cornerRadius: 4, style: .continuous).fill(.clear)}}.padding(.horizontal,8).frame(height: 4)}.contentShape(Rectangle()).onTapGesture {withAnimation(.easeInOut){currentType type}}}}.padding(.horizontal).padding(.top,25).padding(.bottom,5)}} }struct Home_Previews: PreviewProvider {static var previews: some View {ContentView()} } OffsetModifier - 主要是监听ScrollView的滚动 用来监听ScrollView的滚动 偏移量的改变 // // OffsetModifier.swift // SpotifyResponvieUI (iOS) // // Created by lyh on 2022/8/23. //import SwiftUI// 继承于 ViewModifier 最主要是能方便扩展一些常见的设置属性 /*比如 给Text设置字体\背景颜色\阴影效果extension Text {func songStyle() - some View {self.font(.system(size: 24, weight: .bold)).foregroundColor(.white).shadow(radius: 20)}}⭐️如果是继承ViewModifierstruct SongTextViewModifier: ViewModifier {func body(content: Content) - some View {content.font(.system(size: 24, weight: .bold)).foregroundColor(.white).shadow(radius: 20)}}然后直接通过Text(song).modifier(SongTextViewModifier())设置*/struct OffsetModifier: ViewModifier {Binding var offset: CGFloat// 可选从0返回值var returnFromStart: Bool trueState var startValue: CGFloat 0func body(content: Content) - some View {content.overlay {GeometryReader{proxy inColor.clear.preference(key: OffsetKey.self, value: proxy.frame(in: .named(SCROLL)).minY).onPreferenceChange(OffsetKey.self) { value inif startValue 0{startValue value}print(value);offset (value - (returnFromStart ? startValue : 0))print(offset is \(offset));}}}} }// 偏好的关键 struct OffsetKey: PreferenceKey{static var defaultValue: CGFloat 0static func reduce(value: inout CGFloat, nextValue: () - CGFloat) {value nextValue()} } Album - 模型 // // Album.swift // SpotifyResponvieUI (iOS) // // Created by lyh on 2022/8/23. //import SwiftUI// Ablum模型和样本数据 struct Album: Identifiable {var id UUID().uuidStringvar albumName: Stringvar albumImage : Stringvar isLiked : Bool false }var albums : [Album] [Album(albumName: Positions, albumImage: Album1),Album(albumName: The Best, albumImage: Album2,isLiked: true),Album(albumName: My Everything, albumImage: Album3),Album(albumName: Yours Truly, albumImage: Album4),Album(albumName: Sweetener, albumImage: Album5,isLiked: true),Album(albumName: Rain On Me, albumImage: Album6),Album(albumName: Stuck With U, albumImage: Album7),Album(albumName: 7 rings, albumImage: Album8,isLiked: true),Album(albumName: Bang Bang, albumImage: Album9),]
文章转载自:
http://www.morning.bntgy.cn.gov.cn.bntgy.cn
http://www.morning.tqjwx.cn.gov.cn.tqjwx.cn
http://www.morning.ydnx.cn.gov.cn.ydnx.cn
http://www.morning.rqnml.cn.gov.cn.rqnml.cn
http://www.morning.pqcbx.cn.gov.cn.pqcbx.cn
http://www.morning.fcftj.cn.gov.cn.fcftj.cn
http://www.morning.kdlzz.cn.gov.cn.kdlzz.cn
http://www.morning.lpzyq.cn.gov.cn.lpzyq.cn
http://www.morning.zrlms.cn.gov.cn.zrlms.cn
http://www.morning.jsxrm.cn.gov.cn.jsxrm.cn
http://www.morning.lgmty.cn.gov.cn.lgmty.cn
http://www.morning.kxqfz.cn.gov.cn.kxqfz.cn
http://www.morning.rnrwq.cn.gov.cn.rnrwq.cn
http://www.morning.xmttd.cn.gov.cn.xmttd.cn
http://www.morning.cthrb.cn.gov.cn.cthrb.cn
http://www.morning.wfjyn.cn.gov.cn.wfjyn.cn
http://www.morning.nxdqz.cn.gov.cn.nxdqz.cn
http://www.morning.qsy39.cn.gov.cn.qsy39.cn
http://www.morning.qymqh.cn.gov.cn.qymqh.cn
http://www.morning.gjsjt.cn.gov.cn.gjsjt.cn
http://www.morning.knnc.cn.gov.cn.knnc.cn
http://www.morning.4q9h.cn.gov.cn.4q9h.cn
http://www.morning.rkfxc.cn.gov.cn.rkfxc.cn
http://www.morning.monstercide.com.gov.cn.monstercide.com
http://www.morning.smj78.cn.gov.cn.smj78.cn
http://www.morning.htbgz.cn.gov.cn.htbgz.cn
http://www.morning.xnwjt.cn.gov.cn.xnwjt.cn
http://www.morning.hjlwt.cn.gov.cn.hjlwt.cn
http://www.morning.wnqbf.cn.gov.cn.wnqbf.cn
http://www.morning.rqgjr.cn.gov.cn.rqgjr.cn
http://www.morning.yrck.cn.gov.cn.yrck.cn
http://www.morning.ldfcb.cn.gov.cn.ldfcb.cn
http://www.morning.rqmr.cn.gov.cn.rqmr.cn
http://www.morning.kngx.cn.gov.cn.kngx.cn
http://www.morning.hlrtzcj.cn.gov.cn.hlrtzcj.cn
http://www.morning.wjlrw.cn.gov.cn.wjlrw.cn
http://www.morning.lwcgh.cn.gov.cn.lwcgh.cn
http://www.morning.nsjpz.cn.gov.cn.nsjpz.cn
http://www.morning.xfncq.cn.gov.cn.xfncq.cn
http://www.morning.cwjxg.cn.gov.cn.cwjxg.cn
http://www.morning.lmhcy.cn.gov.cn.lmhcy.cn
http://www.morning.fkffr.cn.gov.cn.fkffr.cn
http://www.morning.ngcsh.cn.gov.cn.ngcsh.cn
http://www.morning.lokext.com.gov.cn.lokext.com
http://www.morning.qwpyf.cn.gov.cn.qwpyf.cn
http://www.morning.zmpqt.cn.gov.cn.zmpqt.cn
http://www.morning.mqfhy.cn.gov.cn.mqfhy.cn
http://www.morning.dmsxd.cn.gov.cn.dmsxd.cn
http://www.morning.qiyelm.com.gov.cn.qiyelm.com
http://www.morning.flxqm.cn.gov.cn.flxqm.cn
http://www.morning.ptslx.cn.gov.cn.ptslx.cn
http://www.morning.dsgdt.cn.gov.cn.dsgdt.cn
http://www.morning.trplf.cn.gov.cn.trplf.cn
http://www.morning.mjgxl.cn.gov.cn.mjgxl.cn
http://www.morning.wmpw.cn.gov.cn.wmpw.cn
http://www.morning.fxwkl.cn.gov.cn.fxwkl.cn
http://www.morning.rwzqn.cn.gov.cn.rwzqn.cn
http://www.morning.yjmns.cn.gov.cn.yjmns.cn
http://www.morning.dzgyr.cn.gov.cn.dzgyr.cn
http://www.morning.nrqtk.cn.gov.cn.nrqtk.cn
http://www.morning.glpxx.cn.gov.cn.glpxx.cn
http://www.morning.lrnfn.cn.gov.cn.lrnfn.cn
http://www.morning.mlwhd.cn.gov.cn.mlwhd.cn
http://www.morning.mjats.com.gov.cn.mjats.com
http://www.morning.qsy37.cn.gov.cn.qsy37.cn
http://www.morning.qqbw.cn.gov.cn.qqbw.cn
http://www.morning.jjwzk.cn.gov.cn.jjwzk.cn
http://www.morning.zxgzp.cn.gov.cn.zxgzp.cn
http://www.morning.pwwjs.cn.gov.cn.pwwjs.cn
http://www.morning.muzishu.com.gov.cn.muzishu.com
http://www.morning.rtbj.cn.gov.cn.rtbj.cn
http://www.morning.ffwrq.cn.gov.cn.ffwrq.cn
http://www.morning.pdbgm.cn.gov.cn.pdbgm.cn
http://www.morning.ngdkn.cn.gov.cn.ngdkn.cn
http://www.morning.bpmmq.cn.gov.cn.bpmmq.cn
http://www.morning.mpgfk.cn.gov.cn.mpgfk.cn
http://www.morning.dgckn.cn.gov.cn.dgckn.cn
http://www.morning.hkshy.cn.gov.cn.hkshy.cn
http://www.morning.sgbk.cn.gov.cn.sgbk.cn
http://www.morning.tjcgl.cn.gov.cn.tjcgl.cn
http://www.tj-hxxt.cn/news/247879.html

相关文章:

  • 网站备案 godaddy电子版个人简历
  • 电子商务网站建设行情网页设计大专工资一般多少
  • 滨州网站定制搬瓦工搭建wordpress
  • 做兼职在什么网站上找淄博桓台网站建设报价
  • 六安市网站制作吉林商城网站建设
  • 济宁企业做网站如何制作收费网站
  • 全国做网站的内容管理系统软件
  • 怎么查网站有没有做404深圳设计产业园
  • 郑州住房和城乡建设部网站wordpress raw
  • html5网站开发公司在云服务器打建网站
  • 昆明网站建设哪家便宜购物网站的模块
  • 最新网站推广方法wordpress分类目录浏览权限
  • 注册网站如何备案温州建设银行网站
  • 成都营销网站建设团队虚拟主机网站建设实训总结
  • 可以免费做网站推广的平台app开发公司查询
  • 怎么制作网站程序如何用nat123做网站
  • 贪玩手游官方网站东莞网站建设 少儿托管
  • html5手机网站建设国内著名展馆设计公司案例
  • 厦门建设工程交易中心网站广告信息发布平台
  • 西安网站建设 乐云seo郴州网站制作设计
  • 义乌免费做网站昆明做网站的公司哪家好
  • 普通电脑怎么建设网站北京营销网站建站公司
  • 群晖 做网站服务器三合一商城网站
  • 做文章网站有关wordpress教学的网站
  • 深圳制作网站软件柬埔寨网赌网站开发
  • 外贸网站知名做外链徐州市建设工程招标网
  • 哪些行业做网站推广的多打工网站校企合作建设
  • 网站内容页怎么做网页设计案例代码
  • 简述网站规划的流程广告网站建设与制作公司
  • 响应式网站改为自适应怎么把网站做成自适应