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

why can't i change the CardView_contentPadding? #139

Open
didadida-r opened this issue May 11, 2016 · 0 comments
Open

why can't i change the CardView_contentPadding? #139

didadida-r opened this issue May 11, 2016 · 0 comments

Comments

@didadida-r
Copy link

i want to change the code of MaterialList, so i can freely change the padding of between the cards;
i try this in two way, but both fail.

  1. I want to use the public way setContentPadding() to change the padding of cardview,
    but it don't work.
    LayoutInflater inflater = getLayoutInflater();
    CardLayout cardLayout = (CardLayout) inflater.inflate(R.layout.card_layout, null);
    cardView = (CardView) cardLayout.findViewById(R.id.cardView);
    if(cardView != null){
    Log.v(TAG, "not null");
    cardView.setContentPadding(0, 0, 0, 0);
    }

  2. I change the Constants in the styleable, but it will return to original value as soon as i run the project

            public static final int CardView_contentPadding = 8;
    public static final int CardView_contentPaddingBottom = 12;
    public static final int CardView_contentPaddingLeft = 9;
    public static final int CardView_contentPaddingRight = 10;
    public static final int CardView_contentPaddingTop = 11;
    
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

1 participant