Git Product home page Git Product logo

Comments (9)

dillidon avatar dillidon commented on May 13, 2024 1

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.

egenvall avatar egenvall commented on May 13, 2024

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.

dillidon avatar dillidon commented on May 13, 2024

@egenvall it doesnt work properly(

2018-05-23 22 31 58

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.

egenvall avatar egenvall commented on May 13, 2024

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.

dillidon avatar dillidon commented on May 13, 2024

@egenvall thanks a lot)

from flexlayout.

egenvall avatar egenvall commented on May 13, 2024

@lucdion @dillidon Can close this issue

from flexlayout.

dillidon avatar dillidon commented on May 13, 2024

@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.

egenvall avatar egenvall commented on May 13, 2024

@dillidon I assumed that the issue could be closed after you replied to my solution.
What bugs are you experiencing?

from flexlayout.

lucdion avatar lucdion commented on May 13, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.