Click or drag to resize

CellViewsHolder Class

By design, each cell should have exactly one child and it should hold the views. This is because the cell's GameObject must always be active, while the views may not be.
Inheritance Hierarchy

Namespace:  Com.ForbiddenByte.OSA.CustomAdapters.GridView
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
C#
public abstract class CellViewsHolder : AbstractViewsHolder

The CellViewsHolder type exposes the following members.

Constructors
  NameDescription
Protected methodCellViewsHolder
Top
Methods
  NameDescription
Public methodCollectViews
Calls base's implementation, after which calls GetViews whose result is stored in views
(Overrides AbstractViewsHolderCollectViews.)
Protected methodGetViews
Provide the cell's child GameObject that contains its views
Public methodInit
Cannot be used. Throws InvalidOperationException. Use InitWithExistingRootPrefab(RectTransform) instead
(Overrides AbstractViewsHolderInit(GameObject, Int32, Boolean, Boolean).)
Public methodInitWithExistingRootPrefab

Assigns the root, sets ItemIndex to -1 and calls CollectViews. Note that this uses an already-instantiated cell

root (by the parent group), as opposed to how Init(GameObject, Int32, Boolean, Boolean) works. This is because the group itself manages its cells and their layouting

Public methodMarkForRebuild
Make sure to override this when you have children layouts (for example, a [Vertical/Horizontal/Grid]LayoutGroup) and call MarkLayoutForRebuild(RectTransform) for them. Base's implementation should still be called!
(Overrides AbstractViewsHolderMarkForRebuild.)
Top
Fields
  NameDescription
Public fieldrootLayoutElement
Public fieldviews
The child containing the views, which will be enabled/disabled depending on the layout rules
Top
Version Information

Optimized ScrollView Adapter

Supported in: 4.1
See Also