Git Product home page Git Product logo

Comments (8)

lukasz-gosiewski avatar lukasz-gosiewski commented on May 1, 2024 1

Hello. It seems to me that I encountered the same problem. I've got flexbox layout as a container and I'm adding TextViews to it. However, despite setting margins programmatically they won't appear in the layout. When switching to LinearLayout margins are working without problems. Is there any solution?

from flexbox-layout.

barnaclejive avatar barnaclejive commented on May 1, 2024 1

I am having the same margin problem on programmatically generated child elements of FlexBoxLayout. I have opened a new issue #356

from flexbox-layout.

thagikura avatar thagikura commented on May 1, 2024

layout_marginTop and layout_marginBottom should be taken into account.

Could you also share the enclosing FlexboxLayout's xml and if possible, screenshot of the result (it will be more clear if you check "Show layout bounds" in the developer options)?

from flexbox-layout.

thagikura avatar thagikura commented on May 1, 2024

Also it's not related to the issue, but I recommend removing the LinearLayout. Instead I recommend to make its children (TextView, ImageView) become direct children of the FlexboxLayout if possible. Because it reduces the nested view group, it will gain performance improvement.

If you set layout_wrapBefore to true for a child, the child will become the first item of a flex line (line wrapping is forced). So it can be treated as if a new line (new LinearLayout) is added.

from flexbox-layout.

thagikura avatar thagikura commented on May 1, 2024

Hi, any updates on this one?

Is the issue still persistent?

from flexbox-layout.

thagikura avatar thagikura commented on May 1, 2024

Please reopen it if the issue is still persistent.

from flexbox-layout.

liepang avatar liepang commented on May 1, 2024

@lukasz-gosiewski @thagikura hi, i have the same issue too when i adding the button with margin programmatically, the margins wont appear in layout.

from flexbox-layout.

AndriiBibik avatar AndriiBibik commented on May 1, 2024

How about using couple of '...xml' layouts for your TextView with different margins -> And then just inflate appropriate '...xml' accordingly to situation? I'm just trying to implement...

from flexbox-layout.

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.