惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Forbes - Security
Forbes - Security
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
F
Fortinet All Blogs
B
Blog
T
The Blog of Author Tim Ferriss
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
Y
Y Combinator Blog
Microsoft Azure Blog
Microsoft Azure Blog
L
LangChain Blog
Recent Announcements
Recent Announcements
U
Unit 42
Martin Fowler
Martin Fowler
M
MIT News - Artificial intelligence
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The Register - Security
The Register - Security
Recorded Future
Recorded Future
C
Check Point Blog
V
V2EX
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
Google DeepMind News
Google DeepMind News
酷 壳 – CoolShell
酷 壳 – CoolShell
F
Full Disclosure
小众软件
小众软件
A
About on SuperTechFans
云风的 BLOG
云风的 BLOG
宝玉的分享
宝玉的分享
Last Week in AI
Last Week in AI
有赞技术团队
有赞技术团队
MongoDB | Blog
MongoDB | Blog
爱范儿
爱范儿
P
Proofpoint News Feed
罗磊的独立博客
量子位
D
Docker
博客园_首页
D
DataBreaches.Net
Project Zero
Project Zero
博客园 - 司徒正美
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
博客园 - Franky
Security Latest
Security Latest
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
N
Netflix TechBlog - Medium
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
博客园 - 三生石上(FineUI控件)
H
Hackread – Cybersecurity News, Data Breaches, AI and More
大猫的无限游戏
大猫的无限游戏

Swift

都 vibe coding 了,为啥不把 Rust 项目 rewrite 到 Swift ? 应该怎么解读 swiftui 的崩溃报告? FoundationModels 框架实践 - V2EX Swift DocC 构建的博客 - V2EX Swift server 要支棱起来了 - V2EX 求问贴,如果在 swiftUI 中接入 MySQL C client - V2EX Swift 萌新, DispatchQueue 的一个问题 - V2EX 分享一下一个 Web 前端刚学习 Swift 时候的心得博文 - V2EX 5 分钟用 Swift 写个 ripripgrep - V2EX Swift 操作 plist 文件 使用 SwiftUI + TCA 重构 Instagram Clone:从 Flutter 到 SwiftUI 的迁移实践 激发编程激情,轻松掌握 Swift SwiftUI 分享个基于 UICollectionView 封装的数据驱动和声明式组件库 ListKit 问一个关于 CALayer 的资源释放问题 SwiftUI 的 TextEditor 在 macOS Sequoia 15.0 上输入中文时又会这样一跳一跳的了 Swift 中系统 API delegate 参数一定要在当前类实现传 self 吗 ScreenCaptureKit 里面的 SCStreamOutput 没有被顺利触发,是那个步骤错了,求解惑 - V2EX 似乎 SwiftUI app 在 macOS 15 上启动速度变快很多? - V2EX 请教一个关于 Swift 的基础小问题 - V2EX 离线 iOS app 也需要 ICP ? - V2EX ios 17 widget 无法正确更新 core data - V2EX 有没有 Swift ui 版本的 tailwind css? - V2EX swiftui 里,这里用 hstack,为什么是垂直布局,而不是水平布局? - V2EX 大家觉得 Swift 的参数必须按序提供怎么样? - V2EX Swift 开源的组件库好像不是很多啊 - V2EX Swift 如何像 Python 那样 崩溃了输出 backtrace 或者至少是哪行出错了。。。 - V2EX 请教一下各位 iOSer 巨佬们一个 SwiftUI sheet 组件的问题 - V2EX 请教一下各位 iOSer 巨佬们一个 SwiftUI 中 HStack 的布局问题 - V2EX swiftui 有好用的组件库吗? - V2EX 求问:苹果手机是否无法像安卓一样,可以扫描出本地的音乐? - V2EX macOS 沙盒中如何获得对任意目录的写权限? - V2EX swiftui 中的语法糖疑问 - V2EX 开发 macOS 应用无法访问用户选择的文件夹下的文件 - V2EX 弄了一个 Swift 官方教程的速览版 - V2EX 2024 年了,现在学 SwiftUI 还有必要学 UIkit 吗? - V2EX 大佬们指点下苹果生态下音频相关的这些库都是什么关系? - V2EX 升级到 Xcode 15 之后遇到的 GeneratedAssetSymbols 过不了编译这个问题 - V2EX 现在用 Swift 开发后端成熟了吗? - V2EX Composable SwiftUI - V2EX 2023 年, swiftui 使用 WKWebView 加载 html 字符串,如何自适应 frame 高度? - V2EX 用 network extension 框架开启 Tunnel,怎么能保持后台请求接口,解决请喝杯咖啡 - V2EX 学生党求问各位大佬,一个关于 ios 小组件的问题 - V2EX 比较好的 Swift UI 学习交流群 - V2EX CAID 这垃圾东西是谁在推,一边喊着保护隐私,一边想着法子来跟踪用户 - V2EX Swift 的 Optional 如何比较包装类型的关系呢? - V2EX Alamofire 推荐使用吗? - V2EX 我自己是初学者想找个朋友带我一起写两个工作用的 app 有偿的 - V2EX Swift 如何优化数据加载方式? - V2EX 现在感觉 Swift 真的被 OC 拖后腿了 - V2EX
请教 SwiftUI 布局的问题 - V2EX
whoami9426 · 2024-07-27 · via Swift

想要实现一个上下分页滑动,左右分页滑动的交互效果

 var body: some View{
  ScrollView(showsIndicators: false){
            LazyVStack(spacing:0){
                ForEach(1...10, id: \.self){ index in
                    ScrollView(.horizontal,showsIndicators: false){
                        LazyHStack(spacing:0){
                            
                            VStack {
                                Text("Left View \(index)")
                                    .font(.system(.largeTitle))
                                    .foregroundStyle(.white)
                            }
                            .frame(maxWidth: .infinity, maxHeight: .infinity)
                            .background(Color.black)
                            .containerRelativeFrame([.horizontal,.vertical])
                           
                            
                            VStack {
                                Text("Right View \(index)")
                                    .font(.system(.largeTitle))
                                    .foregroundStyle(.white)
                            }
                            .frame(maxWidth: .infinity, maxHeight: .infinity)
                            .background(Color.blue)
                            .containerRelativeFrame([.horizontal,.vertical])
                            
                        }.scrollTargetLayout()
                    }
                    .ignoresSafeArea()
                    .containerRelativeFrame([.horizontal,.vertical])
                    .scrollTargetBehavior(.paging)
                    .onAppear(perform: {
                        UIScrollView.appearance().bounces = false
                        UIScrollView.appearance().alwaysBounceVertical = false
                        UIScrollView.appearance().alwaysBounceHorizontal = false
                    })
                }
            }.scrollTargetLayout()
        }
        .ignoresSafeArea()
        .containerRelativeFrame([.horizontal,.vertical])
        .scrollTargetBehavior(.paging)
}

目前用这种方式实现,但是有个问题,滑动到 RightView 可以上下滑动到下一层,有什么办法在滑动到 RightView 时只允许左滑回 Left View