mirror of
https://github.com/zhigang1992/rmq.git
synced 2026-01-12 17:52:17 +08:00
26 lines
760 B
Ruby
26 lines
760 B
Ruby
class CollectionControllerStylesheet < ApplicationStylesheet
|
|
|
|
include CollectionCellStylesheet
|
|
|
|
def setup
|
|
# Add stylesheet specific setup stuff here.
|
|
# Add application specific setup stuff in application_stylesheet.rb
|
|
|
|
@margin = ipad? ? 12 : 8
|
|
end
|
|
|
|
def collection_view(st)
|
|
st.view.contentInset = [@margin, @margin, @margin, @margin]
|
|
st.background_color = color.white
|
|
|
|
st.view.collectionViewLayout.tap do |cl|
|
|
cl.itemSize = [cell_size[:w], cell_size[:h]]
|
|
#cl.scrollDirection = UICollectionViewScrollDirectionHorizontal
|
|
#cl.headerReferenceSize = [cell_size[:w], cell_size[:h]]
|
|
cl.minimumInteritemSpacing = @margin
|
|
cl.minimumLineSpacing = @margin
|
|
#cl.sectionInsert = [0,0,0,0]
|
|
end
|
|
end
|
|
end
|