問題タブ [uicollectionviewflowlayout]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
2 に答える
2153 参照

swift - 他の CollectionViews に登録された、複数の異なるセルを持つ CollectionView

私は2つの別々のView Controllerを持っています。

にはViewController1CollectionView1正常に動作する と セルがあります。storyboardwithを使用してセルをセットアップしましたReuseIdentifier "Cell1"

にはViewController2CollectionView2正常に動作する別のセルがあります。storyboardwithも使用してセルをセットアップしましたReuseIdentifier "Cell2"

両方のセルにはカスタム セル クラスがあり、UserCell1UserCell2、および は、個別の 内で正常に動作しますCollectionViews

の 2 番目のセルにはCollectionView2、最初のコレクション ビューのセルを使用します(ie. IndexPath(row: 1, section: 0))

ではCollectionView2、次のものが必要です。

ViewController2、 内で、各 でcellForItemAtどのセルに移動するかを示す数式を使用してみました。ただし、最初のセルは登録されていないと言っています...しかし、同じセルがそのホーム内で機能しているため、明らかに機能しています。dequeueindexViewControllerCollectionViewReuseIdentifier

内部cellForItemAt (numberOfRowsInSection = 2):

私が得ているエラーは次のとおりです。

前もって感謝します!!!!これは私を夢中にさせています:(