Comments (5)
When using nested declarations (or descendant selector chains etc), one must make sure that the leaf element (i.e. cell in this case) is added to the view hierarchy before applying styles. Currently, InterfaCSS doesn't provide any automatic handling for this (this could be accomplished with some method swizzling magic, but I'm trying to avoid such things a much as possible), which means it has to be done manually. One way of doing that is to apply the styles in the willDisplayCell
method of the table view / collection view delegate, another way is to do it in the didMoveToSuperview
method of a custom cell subclass.
I admit, the documentation around this could perhaps be a bit better...
from interfacss.
I'm still not able to make the styling work properly. Sometimes it works, sometimes it does not and it's frustrating. Some tableviews don't get styled until I touch them or scroll them. Please advise. Thanks.
from interfacss.
Sorry to hear. I'm just in the process of improving documentation, and I am also planning on releasing version 1.1 soon, which will bring improvements along with a bunch of new features.
In the meantime, try this:
- Log active declarations for a view using this call
-[InterfaCSS logMatchingStyleDeclarationsForUIElement:]
- Have a look at the SimpleSample demo application - that one uses a UITableView (see
PrototypeExampleViewController
/prototypeExample.css
) with at least a moderately complex style setup - Try and simplify your selectors, i.e. instead using selectors like
UITableView UITableViewCell .myClass
, try using just.myCellClass
for instance
from interfacss.
With regards to tableview cells - I noticed that my styles didn't get
applied when a new cell is allocated (not recycled) -- in this case the
cell has no superview yet. In my case I manually called [tableView
addSubview:cell] inside my tableView:cellForRowAtIndexPath: if
cell.superview was nil. This allowed my styling rules to match - which
included class for my UITableView.
On Tue, Aug 18, 2015 at 6:46 AM, Tadeas Kriz [email protected]
wrote:
I'm still not able to make the styling work properly. Sometimes it works,
sometimes it does not and it's frustrating. Some tableviews don't get
styled until I touch them or scroll them. Please advise. Thanks.—
Reply to this email directly or view it on GitHub
#40 (comment).
from interfacss.
Closing this as there doesn't seem to be an underlying problem and likely just a usage issue, which is now documented on the wiki.
Feel free to reopen the issue in case there are indications that there still are issues with table/collection view cells.
from interfacss.
Related Issues (20)
- UIButton label is styled by UILabel style and cannot be overridden (apparently) HOT 1
- View in some UIViewController inside UITabBarController does not get styled before shown HOT 3
- Support for styling views by controller types. HOT 1
- UITextInputTraits' properties cannot be set using KVC HOT 1
- tvOS configuration HOT 1
- Support for UIStoryboardSegue HOT 5
- Keep x and y values HOT 1
- Support for RGBA hex string HOT 2
- Crash when using IQKeyboardManager HOT 2
- Slow loading time iOS 8.4 HOT 3
- Styling for NSAttributedString HOT 1
- Huge amount of memory used HOT 5
- Crash in ISSelector in v1.4 HOT 16
- guide layout parameter - used but not well documented HOT 3
- How to use division in stylesheet layouts HOT 1
- Variable declaration in 1.4 HOT 1
- [ISSViewBuilder switchWithId:] returns UIStepper HOT 1
- Question & Feature Request: Using system font (iOS) HOT 5
- UIWebView deprecated and will not be allowed after Dec 2020.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from interfacss.