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

UITableView 可以在里面滾動(dòng) UICollectionView 嗎?

Can UITableView scroll with UICollectionView inside it?(UITableView 可以在里面滾動(dòng) UICollectionView 嗎?)
本文介紹了UITableView 可以在里面滾動(dòng) UICollectionView 嗎?的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

我有下面的結(jié)構(gòu)...

我將兩個(gè)集合視圖包裝到 tableview 中

I wrap two of collection views into tableview

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

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

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

All the functions are good (Both collection view).

只是……

當(dāng)我在 Collection2 中向上滾動(dòng)時(shí),Collection1 不會(huì)一起向上滾動(dòng),因?yàn)槲抑粷L動(dòng) collectionViews 而不是 tableview.

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

只有當(dāng)我在 Collection1 中滾動(dòng)時(shí)它才會(huì)一起滾動(dòng).

It only scroll together when I scroll in Collection1.

是否可以讓標(biāo)題視圖像應(yīng)用商店的索引輪播標(biāo)題一樣隨用戶(hù)滾動(dòng)?

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

或者我只是去錯(cuò)了地方,我應(yīng)該用其他方式接近.

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

推薦答案

解決方案

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

    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 的內(nèi)容高度小于或等于 TableViewCell 的高度.正如我在 App Store 上檢查的那樣,他們總是使 SubCollectionView 內(nèi)容高度等于 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).

      更多細(xì)節(jié),你可以看看我的示例項(xiàng)目

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

      https://github.com/trungducc/stackoverflow/tree/app-商店標(biāo)頭

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

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

相關(guān)文檔推薦

how to set scrollview content size in swift 3.0(如何在 swift 3.0 中設(shè)置滾動(dòng)視圖內(nèi)容大小)
Stop a UITableView from automatically scrolling(阻止 UITableView 自動(dòng)滾動(dòng))
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 模擬器上運(yùn)行時(shí),使用 iOS 6.0 SDK 并為 iOS 5 Target 構(gòu)建會(huì)導(dǎo)致 UIScrollView setMinimumZ
Create partial-screen UIPageViewController programmatically(以編程方式創(chuàng)建部分屏幕 UIPageViewController)
how to make an ImageView zoomable with or without ScrollView.?(如何使用或不使用 ScrollView 使 ImageView 可縮放?)
主站蜘蛛池模板: 男人天堂网址 | 亚洲欧美一区二区三区1000 | a视频在线 | 国产一区二区三区在线 | 免费 视频 1级 | 亚洲综合国产精品 | 免费黄色大片 | 伊人伊成久久人综合网站 | 欧美午夜在线 | 欧美一级二级视频 | 超碰97人人人人人蜜桃 | 怡红院怡春院一级毛片 | 日本 欧美 国产 | 国产一区二区三区四 | 91社区在线高清 | 国产精品毛片无码 | 国产一区二区三区在线视频 | 日韩at| 国产一区二区久久 | 夜夜操av | 精品国产乱码久久久久久丨区2区 | 国精品一区二区 | 一区二区在线免费观看 | 日韩视频在线观看一区二区 | 午夜伦理影院 | 国产精品久久久久久久久久久久 | 岛国av一区二区三区 | 毛片网站免费观看 | 免费看a | 欧洲精品在线观看 | 国产xxxx搡xxxxx搡麻豆 | 少妇一级淫片免费放播放 | 中文字幕免费 | 亚洲看片网站 | 精品国产一区二区三区在线观看 | 日日骚网 | 亚洲三区在线 | 日韩插插| 久久精品国产亚洲 | 日韩中文字幕在线免费 | 手机av免费在线 |