Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to add static elements to UICollectionViewController or make them share the same screen with it
    primarykey
    data
    text
    <p><strong>What I want to accomplish:</strong></p> <p>I'm designing a simple game's main screen. On the bottom half of the screen I want it to contain a collection view presenting a list of levels to choose from (long list, horizontally scrollable, nothing fancy - so it may be handled by a standard flow layout). On the top half of the screen I want to have a bunch of static, non-scrollable elements like an image or a label with game title, a static button leading to the credits page, a text field to enter user name etc.</p> <p><strong>The problem:</strong></p> <p>As the focus of this design seems to center around a collection view, I'm trying to use a UICollectionViewController in my storyboard to handle this. However, when I drag UICollectionViewController into my storyboard, it seems to always occupy full screen. I can't find a way to shrink it down nor to drag &amp; drop any button or labels onto it.</p> <p><strong>The question:</strong></p> <p>How can I accomplish such design as described above (collection view occupying only part of the screen, the other part being occupied by some static, non scrollable controls)?</p> <p>Should I:</p> <ol> <li>provide static buttons inside flow layout's header or footer section? (but then I'd have to make them "sticky", so they don't scroll with the rest of the content</li> <li>subclass flow layout and implement static buttons as layout's decoration views</li> <li>create custom container controller with two sections, one with UICollectionViewController, second with a plain view controller with a bunch of static buttons</li> <li>Do not use UICollectionViewController, but instead use a plain UIViewController and handle collection data source and delegate "manually" (it seems as a lot of unnecessary work)</li> <li>maybe I just miss some simple way to drag&amp;drop buttons over UICollectionViewController in XCode's IB (or to configure)</li> <li>any other way to do it?</li> </ol> <p>Please note that: 1. I'm complete iOS newbie, may miss some very obvious solution 2. Apart of sharing the same screen all of my components are very standard, I don't need any custom layouts or behaviours for my collection view or buttons - so I'd like to know whats the cleanest and simplest way to do this (some of potential solutions I proposed above seem like they may work, but for me sound like an overkill to implement such a simple screen)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload