Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio ConstraintLayout with ScrollView

I'm making an app with list of icons, so like two icons per row, I have 8 icons. 4 fit into the view, but the reset doesn't. I've used ConstraintLayout (latest Android Studio).

So, I thought - how do I achieve this ConstraintLayout-positioning and make it scrollable? I've added ScrollView. When it is created, it automatically adds LinearLayout under. So no problem, I remove it, I add ConstraintLayout in it, so that my project looks like this:

ConstraintLayout - ScrollView -- ConstraintLayout

So far so good, but now if I drop any widgets on the Design view or Blueprint view - nothing is added. If I drop it under 2nd constraint layout, it adds up alright, but constraints are built against 1st constraintlayout, and if I switch to 2nd, all constraintlayout controls disappear from top of the design view.

My question is this: how do I make scrollable icon page, positioning it properly (preferably the constraint layout way)?

Thanks!

like image 508
Svyatoslav Avatar asked Jan 20 '17 09:01

Svyatoslav


1 Answers

I believe this can be marked as a duplicate (I don't think I have the points to mark it so) of the following: android Is it possible to put a constraint layout inside a ScrollView

To answer your question, it is not possible currently (as of 10/31/2017) because there is a bug in Android Studio v3.0.0

Check out this image, you can see the ScrollView doesn't act as it should: ScrollView malfunctions with ConstraintLayout

like image 131
Anna Harrison Avatar answered Sep 21 '22 00:09

Anna Harrison