SBIconList: Difference between revisions

From iPhone Development Wiki
No edit summary
(Added info gathered from FCSB and Iconoclasm development)
Line 4: Line 4:
== Notable Subclasses ==
== Notable Subclasses ==
* [[SBButtonBar]] is a subclass that is used for the dock.
* [[SBButtonBar]] is a subclass that is used for the dock.
== Modifying the dimensions of SBIconList ==
The dimensions (max rows and columns) can be modified by hooking into the ''maxIconColumns'' and ''maxIconRows'' methods. The OS will attempt to space the icons according to default spacing, so adding a fifth column would cause the fifth column to wrap to the next row. Icon origins can be changed by hooking into ''originForIconAtX:Y:''. The OS reuses icons to save on object allocations; as soon as a column is estimated as being off-screen, the icons get reused for the next column to appear onscreen. If the number of maximum columns goes over 5 (3.x) or 4 (2.x), you may notice flickering when switching pages.
* '''Note:''' CategoriesSB takes advantage of a quirk in the ''originForIconAtX:Y:'' where going beyond the bounds of the maximum columns/rows returns the value where such a row or column ''would'' be. Do not assume all calls to this method will be comprised within the max icon column/row bounds.

Revision as of 21:18, 8 January 2010


SBIconList is a view containing one or several icons. Each page on the home screen is a different instance of SBIconList.

Notable Subclasses

Modifying the dimensions of SBIconList

The dimensions (max rows and columns) can be modified by hooking into the maxIconColumns and maxIconRows methods. The OS will attempt to space the icons according to default spacing, so adding a fifth column would cause the fifth column to wrap to the next row. Icon origins can be changed by hooking into originForIconAtX:Y:. The OS reuses icons to save on object allocations; as soon as a column is estimated as being off-screen, the icons get reused for the next column to appear onscreen. If the number of maximum columns goes over 5 (3.x) or 4 (2.x), you may notice flickering when switching pages.

  • Note: CategoriesSB takes advantage of a quirk in the originForIconAtX:Y: where going beyond the bounds of the maximum columns/rows returns the value where such a row or column would be. Do not assume all calls to this method will be comprised within the max icon column/row bounds.