Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set Tree node to accept full width #139

Open
prasad456 opened this issue Dec 27, 2017 · 2 comments
Open

Set Tree node to accept full width #139

prasad456 opened this issue Dec 27, 2017 · 2 comments

Comments

@prasad456
Copy link

I used Custom View for the node it applies as wrap Content I used the views as MAtch Parent

@ehsanhvd
Copy link

ehsanhvd commented May 15, 2018

public static class MyHolder extends TreeNode.BaseNodeViewHolder<Category> {

        public MyHolder(Context context) {
            super(context);
        }

        @Override
        public View createNodeView(final TreeNode node, Category value) {
            final LayoutInflater inflater = LayoutInflater.from(context);
            final View view = inflater.inflate(R.layout.row_category_simple, null, false);
           ViewGroup.LayoutParams rootParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
            view.setLayoutParams(rootParams);  ///////*********set layout params to your view
           
            return view;
        }
    }

@testica
Copy link

testica commented Jan 16, 2019

@ehsanhvd Nice workaround 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants