久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

UITableView 可以在里面滾動 UICollectionView 嗎?

Can UITableView scroll with UICollectionView inside it?(UITableView 可以在里面滾動 UICollectionView 嗎?)
本文介紹了UITableView 可以在里面滾動 UICollectionView 嗎?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我有下面的結構...

我將兩個集合視圖包裝到 tableview 中

I wrap two of collection views into tableview

一個在tableview header(Collection1),另一個在tableview第一行(Collection2).

One is in tableview header(Collection1), another is in tableview 1st row(Collection2).

所有功能都很好(兩個集合視圖).

All the functions are good (Both collection view).

只是……

當我在 Collection2 中向上滾動時,Collection1 不會一起向上滾動,因為我只滾動 collectionViews 而不是 tableview.

When I scroll up in Collection2, Collection1 will Not scroll up together, because I'm only scrolling the collectionViews not the tableview.

只有當我在 Collection1 中滾動時它才會一起滾動.

It only scroll together when I scroll in Collection1.

是否可以讓標題視圖像應用商店的索引輪播標題一樣隨用戶滾動?

Is it possible to make the header view scroll with user just like app store's index carousel header?

或者我只是去錯了地方,我應該用其他方式接近.

Or I just went to the wrong place, I should use other ways to approach.

推薦答案

解決方案

  • 當你將 CollectionView1 保留為 TableViewHeader 時,CollectionView1 到達頂部后將始終位于 TableView 的頂部.如果您希望 Collection1 和 Collection2 一起向上滾動,則需要將 CollectionView1 保留在單元格中,而不是標題中.

    Solution

    • When you keep CollectionView1 as a TableViewHeader, CollectionView1 will always on the top of TableView after it reaches top. If you want Collection1 and Collection2 scroll up together, you need to keep CollectionView1 in a cell, not a header.

      確保 CollectionView2 的內容高度小于或等于 TableViewCell 的高度.正如我在 App Store 上檢查的那樣,他們總是使 SubCollectionView 內容高度等于 TableViewCell 的高度(如果他們使用 TableView).

      Make sure CollectionView2 content height smaller or equal to TableViewCell's height. As I checked on App Store, they always make SubCollectionView content height equal to TableViewCell's height (If they use TableView).

      更多細節,你可以看看我的示例項目

      For more detail, you can take a look at my sample project

      https://github.com/trungducc/stackoverflow/tree/app-商店標頭

      這篇關于UITableView 可以在里面滾動 UICollectionView 嗎?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

      【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

how to set scrollview content size in swift 3.0(如何在 swift 3.0 中設置滾動視圖內容大小)
Stop a UITableView from automatically scrolling(阻止 UITableView 自動滾動)
iOS UIScrollView Lazy Loading(iOS UIScrollView 延遲加載)
using iOS 6.0 SDK and building for iOS 5 Target causes UIScrollView setMinimumZoomScale to fail when running on iOS 5 simulator(在 iOS 5 模擬器上運行時,使用 iOS 6.0 SDK 并為 iOS 5 Target 構建會導致 UIScrollView setMinimumZ
Create partial-screen UIPageViewController programmatically(以編程方式創建部分屏幕 UIPageViewController)
how to make an ImageView zoomable with or without ScrollView.?(如何使用或不使用 ScrollView 使 ImageView 可縮放?)
主站蜘蛛池模板: 国产在线精品一区二区三区 | 午夜精品一区二区三区在线视 | 亚洲图片视频一区 | 人操人人干人 | www.av在线 | 亚洲码欧美码一区二区三区 | 精品视频一区二区三区 | 国产成人影院 | 欧美2区| 高清成人av | 亚洲一区二区三区在线视频 | 美女黄18岁以下禁止观看 | 精品免费 | 亚洲精品美女视频 | 91视频官网 | 日韩第一夜 | 精品欧美一区二区精品久久久 | 亚洲综合婷婷 | 一区二区不卡视频 | 亚洲一区中文字幕 | 中文字幕一区二区三 | 国产成人精品免费 | 国产日韩欧美在线播放 | 色悠悠久 | 久久久久久国产精品免费免费 | 99re国产视频 | 国产成人免费 | 国产欧美一区二区久久性色99 | 美女视频一区二区 | 操人网| 干干干日日日 | 在线观看免费av网 | 国产亚洲一区二区三区在线观看 | 无吗视频 | 日韩欧美手机在线 | 北条麻妃视频在线观看 | 日本a∨精品中文字幕在线 亚洲91视频 | 中文字幕av一区二区三区 | 亚洲一区二区三区免费在线观看 | 亚洲精彩视频在线观看 | 九九久久久 |