To quickly resolve this, use this very helpful shortcut in Android Studio:
Right-click widget-in-question > Constraint Layout > Infer Constraints:
Thereafter, you can tweak the constraints as described here: https://stackoverflow.com/a/37960888/5556250
This is not correct for the Android Studio v3 and up. As per @purpleladydragons’s comment:
“Constraint Layout” is not in the dropdown menu. Use the magic wand icon in the toolbar menu above the design preview; there is the “Infer Constraints” button.