Class: Layout
- Inherits:
-
Object
- Object
- Layout
- Defined in:
- lib/under_os/ui/collection/layout.rb
Overview
The basic, grid (flow) layout. inheritable.
Instance Attribute Summary collapse
-
#_ ⇒ Object
readonly
Returns the value of attribute _.
Instance Method Summary collapse
-
#initialize(layout = nil) ⇒ Layout
constructor
A new instance of Layout.
- #item_size ⇒ Object
- #item_size=(*size) ⇒ Object
- #items_spacing ⇒ Object
- #items_spacing=(value) ⇒ Object
- #rows_spacing ⇒ Object
- #rows_spacing=(value) ⇒ Object
- #section_inset ⇒ Object
- #section_inset=(value) ⇒ Object
Constructor Details
#initialize(layout = nil) ⇒ Layout
Returns a new instance of Layout.
7 8 9 10 11 12 |
# File 'lib/under_os/ui/collection/layout.rb', line 7 def initialize(layout=nil) @_ = layout || UICollectionViewFlowLayout.alloc.init self.items_spacing = 0 self.rows_spacing = 1 end |
Instance Attribute Details
#_ ⇒ Object (readonly)
Returns the value of attribute _.
5 6 7 |
# File 'lib/under_os/ui/collection/layout.rb', line 5 def _ @_ end |
Instance Method Details
#item_size ⇒ Object
14 15 |
# File 'lib/under_os/ui/collection/layout.rb', line 14 def item_size end |
#item_size=(*size) ⇒ Object
17 18 19 20 |
# File 'lib/under_os/ui/collection/layout.rb', line 17 def item_size=(*size) size = UnderOs::Point.new(*size) @_.itemSize = CGSizeMake(size.x, size.y) end |
#items_spacing ⇒ Object
22 23 24 |
# File 'lib/under_os/ui/collection/layout.rb', line 22 def items_spacing @_.minimumInteritemSpacing end |
#items_spacing=(value) ⇒ Object
26 27 28 |
# File 'lib/under_os/ui/collection/layout.rb', line 26 def items_spacing=(value) @_.minimumInteritemSpacing = value end |
#rows_spacing ⇒ Object
30 31 32 |
# File 'lib/under_os/ui/collection/layout.rb', line 30 def rows_spacing @_.minimumLineSpacing end |
#rows_spacing=(value) ⇒ Object
34 35 36 |
# File 'lib/under_os/ui/collection/layout.rb', line 34 def rows_spacing=(value) @_.minimumLineSpacing = value end |
#section_inset ⇒ Object
38 39 |
# File 'lib/under_os/ui/collection/layout.rb', line 38 def section_inset end |
#section_inset=(value) ⇒ Object
41 42 |
# File 'lib/under_os/ui/collection/layout.rb', line 41 def section_inset=(value) end |