菜鸟教程小白 发表于 2022-12-11 17:20:52

ios - 如何更改 iOS 中网格和列表的 UICollectionView 布局


                                            <p><div>
            <aside class="s-notice s-notice__info post-notice js-post-notice mb16"role="status">
      <div class="d-flex fd-column fw-nowrap">
            <div class="d-flex fw-nowrap">
                <div class="flex--item wmn0 fl1 lh-lg">
                  <div class="flex--item fl1 lh-lg">
                        <b>这个问题在这里已经有了答案</b>:
                        
                  <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>将 <code>segmentcontroller</code> 与 <code>uicollectionviewcontroller</code> 和 <code>uitableviewcontroller</code> 一起使用。然后为两者<code>实现委托(delegate)方法和数据源方法</code>。然后隐藏一个 <code>view controller</code> <code>tableview</code> 或 <code>collectionview</code>。然后为 <code>segment controller</code> 实现 <code>action</code>。</p>

<p>当 <code>segment index == 0</code> 显示 <code>collectionview</code> 否则显示 <code>tableview</code>。希望这对你有帮助。</p>

<p>否则您可以将相同的 <code>uicollectionveiw</code> 与 <code>sections</code> 一起使用。</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 如何更改 iOS 中网格和列表的 UICollectionView 布局,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/39117559/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/39117559/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 如何更改 iOS 中网格和列表的 UICollectionView 布局