tolo / InterfaCSS

The CSS-inspired styling and layout framework for iOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UICollectionViewLayout style

tbrannam opened this issue · comments

Do you have an idea on how you'd like to see describing the style for a UICollectionViewFlowLayout? Or the ability to specify a concrete instance of an alternative layout?

It would be great to allow configuration of the default, but it would also be nice to be able to pass properties to the layout to allow it to be configured as well. Consider both UICollectionViewFlowLayout and the more generic UICollectionViewLayout. The later will likely require a much more flexible definition of properties.

I've added support for modifying the attributes of the standard UICollectionViewFlowLayout, but I'm not sure how much more support than that I'm going to add in InterfaCSS when it comes to collection views. But we'll see.

When it comes to layout in general however, I have begun experimenting with adding support for expressing position and size relative to other views than the parent view. Stay tuned... :)

Yes, it would be hard to have a general style rules for a UICollectionViewLayout. It might be enough to support specification of the Layout Class in the collectionview xml markup? And then leave it to the user to implement custom styles for their custom layout.

Or perhaps support changing the collectionViewLayout implementation based on class styles?

UICollectionView.layoutclass {
collectionViewLayout: "MyCustomLayoutClass";
collectionViewLayout.myCustomAttributes: "foo";
}

If styles are applied in order - it might be possible to apply attributes to an instance of MyCustomLayoutClass. But in practice that doesn't seem like a good CSS assumption.

Added support for layoutClass attribute in commit aafa069.

Great!