Programmatically set margin to ConstraintLayout

Finally with help of @Aksh I found my mistake and solve my problem. If someone find it useful, I will put my code bellow

     ConstraintLayout.LayoutParams newLayoutParams = (ConstraintLayout.LayoutParams) toolbar.getLayoutParams();
     newLayoutParams.topMargin = 0;
     newLayoutParams.leftMargin = 0;
     newLayoutParams.rightMargin = 0;
     toolbar.setLayoutParams(newLayoutParams);

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)