Recently I was going through the tutorials of constraint layout (new in Android Studio 2.2). In the tutorials they had buttons used for constraints layout on the bar but there are no buttons in my Android Studio. See image below:
Add below-given dependencies in build.gradle(app)
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta5'
}
Please do as shown below in your layout
Then after refreshing the project, click on the layout and all buttons will remain visible for yourself to work upon constraints.
I also had an issue finding the constraints button while following the official tutorials. Being a n00b, I didn't realize that constraints was a layout in itself (the tutorial skips over that) and since I started with a different activity better aligned to my purposes, it used a ContainerLayout instead of a ConstraintLayout.
In my case, ConstraintLayout is already available, so the previous answer doesn't really provide the proper solution.
So, some basic options to make the tutorial go as expected are:
- (A) Start over and follow the tutorial as specified.
- (B) Convert the ContainerLayout to a ConstraintLayout by right-clicking on Container in the ComponentTree. You may have to fuss around with it after conversion to get it to align to the tutorial.
- (C) Create a new activity that matches the tutorial (e.g. 'Empty Activity') and it will use the ConstraintLayout. Use that activity to follow the tutorial.
Simple, yes, but not necessarily obvious to the n00bs. Hope it helps.
I think I found the button! I somehow found the menu item first (thanks to Reddit), and am wondering how I could have possibly missed the button, since I looked quite a bit at the row directly above it, but, there it is.
In my case when I put the constraintlayout inside scrollview all the constraint layout buttons disappeared . I got them back when I restored the constraintlayout as the root container.
© 2022 - 2024 — McMap. All rights reserved.