Error ConstraintLayout Negative Margin (ECNM)


ECNM:   SOLD       




Hi dev, this new experience I got when designing android UI using several different components such as LinearLayout, RelativeLayout and ConstraintLayout. It turns out that we can't average out the implementation of several attributes such as setting margin values, for example.

android:layout_marginTop="-14dp"

Applying negative values ​​like the example above can only be applied in LinearLayout and RelativeLayout, so you won't see the same changes if it is applied in ConstraintLayout.

So, the solution is please use  translationX  (for horizontal shift) and  translationY  (for vertical shift), for example.

android:translationX="-10dp"
android:translationY="-10dp"

Another alternative is to enter a value space, this is a bit ticky, but highly discouraged, even if you want similar results.


Post a Comment

Previous Next

نموذج الاتصال