ios - 每个部分的 UICollectionView 布局
<p><p>我需要将我的 <code>UICollectionView</code> 部分之一设置为水平滚动,而 <code>UICollectionView</code> 的其余部分则垂直滚动。</p>
<p>例如:<strong>SECTION 1</strong>下面应该从左到右滚动,整个<code>UICollectionView</code>上下滚动。</p>
<pre><code>| | ^
| [ SECTION 0 ] |
| | |
| [ <--> ] | |
| [ SECTION 1 ] | |
| [ <--> ] | |
| | |
| [ SECTION 2 ] |
| | ˅
</code></pre>
<p>您不能在 <code>UICollectionViewCell</code> 内嵌套新的 <code>UICollectionView</code>,所以这是不可能的。我也不想使用 <code>UITableView</code> 和 <code>UICollectionView</code> 因为我需要大多数其他部分是网格布局。</p>
<p>关于如何实现这一点的任何想法?</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>采用 <strong>Tableview</strong> 它将 <strong>scroll</strong> <strong>vertically</strong> 然后在 UITablviewCell 中采用 UIView(这样做是为了使 collectionview 和 tableview 的委托(delegate)不冲突) ,使用 <strong>UIView</strong> 获取 <strong>UICollectionview</strong> 并使其<strong>滚动</strong> <strong>水平</strong>。因此您可以轻松实现。</p>
<blockquote>
<p>UITableView->UITbaleviewCell->In Tableviewcell a UIView->then
UICollectionview->UICollectionviewCell</p>
</blockquote></p>
<p style="font-size: 20px;">关于ios - 每个部分的 UICollectionView 布局,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/38493120/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/38493120/
</a>
</p>
页:
[1]