title: How to dynamically align an ImageView to centre of Constraint Layout?
body: <p>I am trying to align an image view to centre of constraint layout. I am writing below code but its not working.</p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>int size = 150;
  ConstraintLayout.LayoutParams layoutParams = new ConstraintLayout.LayoutParams(size, size);
  
  layoutParams.bottomToBottom = ConstraintSet.PARENT_ID;
  layoutParams.endToEnd = ConstraintSet.PARENT_ID;
  layoutParams.startToStart = ConstraintSet.PARENT_ID;
  layoutParams.topToTop = ConstraintSet.PARENT_ID;
  
  circleImageView.setLayoutParams(layoutParams);
  </code></pre>