Comments (9)
I've just solved this with PinLayout and didnt make a screenshot. Same amount of code with PinLayout. Your framework does not work correctly. Simple rules work fine, but when you need to do something a little more complicated, errors appear. Not only in this moment, but in others. Too many functions and it is not clear how they will act together. If you do it by intuition or by your instructions, then nothing happens with complicated situations. Close the topic.
from flexlayout.
One way to do it is to have two containers.
Container A is containing Container B & Your Button
Container B is containing your labels.
Just make some modifications to the grow, shrink & sizing depending on your needs and it should work. (Didn't try it)
Edit: See last post
from flexlayout.
@egenvall it doesnt work properly(
The button with price can be of different width depends on the price itself, so maxWidth
that solves, but margin between 2 labels and button doesnt work if button set with .position(.absolute).right(0)
...
Please, help)
from flexlayout.
You should not place the button using .position(.absolute)
Sat down with Xcode now:
cardContainer.addItem().position(.absolute).left(16).right(16).bottom(16)
.backgroundColor(.blue).direction(.row).justifyContent(.spaceBetween).alignItems(.center).define { detailContainer in
detailContainer.addItem().backgroundColor(.yellow).marginRight(16).grow(1).shrink(1).define { textContainer in
textContainer.addItem(titleLabel)
textContainer.addItem(subtitleLabel)
}
detailContainer.addItem(button).shrink(0)
}
Result: https://webmshare.com/3XYVr
Now you probably won't change the button content at click, but this demonstrates the resizing. You could also fit the label size to fit the new width
from flexlayout.
@egenvall thanks a lot)
from flexlayout.
@lucdion @dillidon Can close this issue
from flexlayout.
@egenvall if you want, but the problem is not still solved. I tried all possible combinations and always one or two bugs. I think you should rethink logiq of your framework.
from flexlayout.
@dillidon I assumed that the issue could be closed after you replied to my solution.
What bugs are you experiencing?
from flexlayout.
I agree with you @dillidon 🙂, in many situation PinLayout gives you the full control over your layout. And yes, there are few issues with Yoga's implementation of flexbox (https://github.com/facebook/yoga).
from flexlayout.
Related Issues (20)
- UILabel will get out of superview's bounds when text is too long HOT 2
- error: 'YGEnums.h' file not found HOT 3
- 'grow' not take up rest of space of cotainer. HOT 3
- 'YGEnums.h' file not found Error HOT 4
- Pods/FlexLayout/Sources/yoga/Yoga-internal.h:9:10: 'algorithm' file not found HOT 5
- how to use inline-flex feature HOT 1
- Are there plans to support macos? HOT 1
- FlexLayout package does not build with SwiftPM HOT 1
- 'YGEnums.h' file not found - When adding FlexLayout as dependency of another Swift Package. HOT 8
- ABI stability swift evolution support for different swift versions
- Use of bitwise '|' with boolean operands HOT 4
- Swift Error causing debugger not working
- Crash occurs when a `.wrapReverse` flexbox container has a `.display(.none)` item.
- Flexbox gap of Yoga in FlexLayout? HOT 2
- Child already has a owner, it must be removed first. HOT 6
- Override UITableViewCell
- The same code get different results in versions 1.3.33 and 2.0.07.
- Xcode15 crash HOT 1
- UITextView cannot be edited HOT 1
- When will be support Yoga 3.0?
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 flexlayout.