Getting “Error: Missing Constraints in ConstraintL

2020-08-25 04:23发布

问题:

I am using Android Studio 3.0.1. Whenever I drag button or do any other activity on my Activity Screen it gives me the following error

Missing Constraints in ConstraintLayout"

I need a permanent fix for this issue. Please help me.

回答1:

See in the pallete just above your design you will see a wand type tool, when you will hover over it it will show infer constraint , just click on it and your problem will be solved



回答2:

Go to the text view in your .xml file hover the cursor to the Error part(Red Underline) and Press (Alt + Enter) it will show you to automatically add the missing things select that and it will be resolved