Change Guideline percentage in constraint layout programmatically
问题 I have a guideline in constraint layout like this <android.support.constraint.Guideline android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/guideline8" app:layout_constraintGuide_percent="0.5" android:orientation="vertical"/> Later I want to change the app:layout_constraintGuide_percent value to something else conditionally. How can I achieve this. 回答1: There is two ways to do it: Using ConstraintLayout.LayoutParams This method get a specific parameter