I'm using Android Studio 3.0 (updated to canary 4 today) on macOS for a side project and recently (not sure really when) the constraint layout editor stopped working properly.
Now it just shows a grey window and the blueprint view isn't working at all. Even the properties editor on the right doesn't show the constraints anymore.
Here how it looks for a simple layout with just 1 button:
I'm using constraint layout 1.0.2
but it fails the same way on 1.1.0-beta1
.
Any idea what could go wrong? No error are shown in the IDE or in the idea.log
Thanks in advance for any help provided :)
Open the layout file (activity_main. xml) in Android Studio and click the Design tab at the bottom of the editor window. In the Component Tree window, right-click LinearLayout and then choose Convert layout to ConstraintLayout from the context menu.
A ConstraintLayout is a ViewGroup which allows you to position and size widgets in a flexible way. Note: ConstraintLayout is available as a support library that you can use on Android systems starting with API level 9 (Gingerbread). As such, we are planning on enriching its API and capabilities over time.
You can't use relative layout directly inside constraint layout. Intention of ConstraintLayout is to optimize and flatten the view hierarchy of your layouts by applying some rules to each view to avoid nesting.
To define a Barrier , you can select one or more View components from the “Design” view, open the “Guidelines” menu and select the Barrier . If you want to add it directly in the XML, you can use the following code snippet: The resulting layout looks like the screenshot of the “Design” layout editor view from below.
Which gradle version are you using? Also, support lib 26.0.0-beta2 has an issue with studio, if you are using it you should downgrade to beta1 to use the editor.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With