Comments (4)
Great find—this is a shortcoming in our flexbox implementation (CKStackLayoutComponent
). You're looking for the equivalent of justify-content: space-between;
but we don't support it yet.
If you'd like to submit a patch to the stack layout implementation to support this, it'd be much appreciated. Otherwise, I'll try to find someone to add support.
For now, you can fake it by putting in a spacer with flexGrow = YES
:
+ (instancetype)newWithText1:(NSString *)text1 text2:(NSString *)text2
{
return [super
newWithComponent:
[CKStackLayoutComponent
newWithView:{}
size:{}
style:{
.direction = CKStackLayoutDirectionHorizontal,
.alignItems = CKStackLayoutAlignItemsCenter
}
children:{
{
[CKLabelComponent
newWithLabelAttributes:{
.string = text1,
.font = [UIFont systemFontOfSize:20],
.color = [UIColor blackColor]
}
viewAttributes:{
{@selector(setBackgroundColor:), [UIColor clearColor]}
}],
.alignSelf = CKStackLayoutAlignSelfStretch
},
{
[CKComponent new],
.flexGrow = YES,
},
{
[CKLabelComponent
newWithLabelAttributes:{
.string = text2,
.font = [UIFont systemFontOfSize:20],
.color = [UIColor redColor],
.alignment = NSTextAlignmentRight
}
viewAttributes:{
{@selector(setBackgroundColor:), [UIColor clearColor]}
}],
.alignSelf = CKStackLayoutAlignSelfStretch
}
}]];
}
from componentkit.
By the way, I created the componentkit
tag on StackOverflow for you and I'll monitor it for future questions. Since I had to create a question to create the tag, here's your question there:
from componentkit.
⭐
from componentkit.
Hi, seems that CK is still not support justify-content: space-between now?
from componentkit.
Related Issues (20)
- Component not release
- [Documentation] Views path is not render HOT 3
- Delete 'Carthage/Checkouts' directory
- question - docs (docusaurus) repo? HOT 2
- Xcode not building ComponentKit checked out via cocoapods HOT 2
- Docusaurus source code
- question: My component is not getting full width in screen landscape mode. HOT 1
- Not Support Incremental mount
- Build Error with "RenderCoreLayoutCaching" HOT 1
- ComponentKit does not compile with Xcode 12.5 HOT 1
- Compile Error: Block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior HOT 1
- How do I pass multiple arguments
- Unsupported Swift Version: “FBSnapshotTestCase iOS” contains source code developed with Swift 3.x.
- [Question]How to unmount components from HostingView?
- How to make children component height equal to Scroll component's content view height but Scroll component's height HOT 2
- Yoga-internal.h:135:11: error: definition of implicit copy constructor for 'Values<9>' is deprecated
- CKNonNull.h:47:33 No member named 'move' in namespace 'std'; did you mean 'modf'?
- Abandoned?
- ComponentKit/ComponentKit.xcconfig is compiled as source code
- Unable to compile example project
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 componentkit.