How to add views programatically #1039

Closed
opened 2020-11-10 03:59:43 -08:00 by heba-mekawi · 1 comment
heba-mekawi commented 2020-11-10 03:59:43 -08:00 (Migrated from github.com)

Report

Issues and Steps to Reproduce

       YogaNode rootNode = binding.yoga.getYogaNode();
        rootNode.setJustifyContent(YogaJustify.SPACE_AROUND);
        rootNode.setAlignItems(YogaAlign.AUTO);
        rootNode.setAlignContent(YogaAlign.CENTER);

        YogaNode imageNode = new YogaNodeJNIFinalizer();
        imageNode.setAlignSelf(YogaAlign.CENTER);

        ImageView image = new ImageView(getContext());
        image.setImageResource(R.drawable.geometric_outlined_call);

        binding.yoga.addView(image, imageNode);

Expected Behavior

To see an image view in the layout

Actual Behavior

No views displayed

Any help please?

# Report - [x] I have searched [existing issues](https://github.com/facebook/yoga/issues) and this is not a duplicate # Issues and Steps to Reproduce ``` YogaNode rootNode = binding.yoga.getYogaNode(); rootNode.setJustifyContent(YogaJustify.SPACE_AROUND); rootNode.setAlignItems(YogaAlign.AUTO); rootNode.setAlignContent(YogaAlign.CENTER); YogaNode imageNode = new YogaNodeJNIFinalizer(); imageNode.setAlignSelf(YogaAlign.CENTER); ImageView image = new ImageView(getContext()); image.setImageResource(R.drawable.geometric_outlined_call); binding.yoga.addView(image, imageNode); ``` # Expected Behavior To see an image view in the layout # Actual Behavior No views displayed Any help please?
NickGerleman commented 2023-04-25 20:44:18 -07:00 (Migrated from github.com)

We're deprecating the com.facebook.yoga.android.YogaLayout ViewGroup in the next major release of Yoga. We intend to still push out a new version aligned to the core Yoga 2.0. I have bulk closed ViewGroup issues to reflect that we are not planning to invest time into functional changes of the ViewGroup. and eventually intend to remove it from the repo.

We're deprecating the `com.facebook.yoga.android.YogaLayout` ViewGroup in the next major release of Yoga. We intend to still push out a new version aligned to the core Yoga 2.0. I have bulk closed ViewGroup issues to reflect that we are not planning to invest time into functional changes of the ViewGroup. and eventually intend to remove it from the repo.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DaddyFrosty/yoga#1039
No description provided.