12

So I have been developing this layout using a ConstraintLayout inside a ScrollView. It works fine, but now I have hit a problem. I have to expand the layout outside the screen. I can scroll in Design mode, but I cannot add anything without it getting stuck to the top. The constraints are for earlier objects, not the current one I'm adding.

I can add constraints in Blueprint mode, but it looks like I cannot scroll the ScrollView in blueprint mode. Is this even possible? Using Android Studio 2.2(release) and constraint-layout:1.0.0-alpha8

I tried doing it like in Design mode, but it doesn't scroll. Any ideas?

Scrolling normally with ConstraintLayout causes the constraints to stay in the same location.

EDIT:

Updated to alpha9 but still does not solve it

EDIT 2:

beta1 does not work either. AS 2.2.2.

EDIT 3:

Sample layout:

<Button
    android:text="Button"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/sampleButton"
 />

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:ignore="HardcodedText">

    <android.support.constraint.ConstraintLayout

        android:orientation="vertical" android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <!-- ETC constraints -->
    </android.support.constraint.ConstraintLayout>
</ScrollView>

Zoe
  • 27,060
  • 21
  • 118
  • 148

6 Answers6

3

In android studio 2.2 update, it includes scrolling in design and blueprint mode by default. click on design mode in the preview pane and try to scroll your screen it will start scrolling. There is another option of blueprint in that mode it shows you the blueprint of the design and by doing same for this will help you scroll in blueprint mode also.

enter image description here enter image description here

  • 1
    Tried to scroll in blueprint mode - no scrolling happens. trying to do it in design mode leads to the constraints not moving(meaning editing constraints only applies to the first elements, not the ones that are in the scroll visible area). – Zoe Oct 18 '16 at 13:24
  • 1
    Meaning no objects move in blueprint mode even though it should. – Zoe Oct 18 '16 at 13:26
  • Can you post a screenshot of your layout file? – Keval Patel Oct 22 '16 at 13:27
  • 1
    Just to clarify here: I want to scroll a ConstraintLayout in a scrollview; Not a RelativeLayout or a LinearLayout. – Zoe Oct 22 '16 at 21:03
2

Put the Scroll view outside of the Constraint layout. Then use this [Red mark] to drag the view and it will make a custom device editor to you. When you have done, change back to the device editor [Beside rotation icon]...

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
Samin
  • 577
  • 6
  • 6
  • That is a workaround, not a solution. IT doesn't allow me(or anyone else) to scroll a scrollview in blueprint mode. It induces high amounts of lag and issues of etc types. It works for a while, before the length goes off the screen. At which point zoom is necessary (zoom out) which makes all the objects small and hard to see. And the bigger the device is, the more lag the drag and drop system has. After a while with it, dragging a constraint had several seconds of delay. **TL:DR;** NOt a solution, a workaround with lots of lag – Zoe Mar 03 '17 at 18:17
  • this solution is best when designing constraint layout with scrollview. as of now all scrollview issues are solved with constraint layout 1.0.2 but blue print editor has still this issue of scrolling the whole view to top while editing anything. – Raghav Satyadev Sep 12 '17 at 05:44
1

Not yet.

Maybe try to have a separate file to edit the content instead, and use an include in the file where you have the ScrollView?

Frederic Klein
  • 2,846
  • 3
  • 21
  • 37
Nicolas Roard
  • 8,339
  • 1
  • 28
  • 30
1

In latest android studio 2.2.2 version with constraint-layout:1.0.0-beta1 you can scroll blueprintenter image description here

for better working, after updating constraint-layout please restart android studio (invalidate caches)

Basi
  • 3,009
  • 23
  • 28
  • Android Studio 2.2.2 release and constraint layout beta1 - does not work. Cache invalidated – Zoe Oct 22 '16 at 20:49
  • 1
    Update on this: Still doesn't work. The views appear to move, but the [bounding boxes? not sure what they are called] and constraints do not move. With CL 1.0.1 release – Zoe Mar 03 '17 at 18:19
1

As of ConstraintLayout 1.0.1 scrolling scrolls the constraints. Meaning it is possible to scroll a ConstraintLayout in blueprint mode and it functions as expected. It works at Android Studio 2.3.2 and up (I haven't older versions).

Now when scrolling, both the visible view, the border, and constraints move along with the drawn button.

Zoe
  • 27,060
  • 21
  • 118
  • 148
0

beta1 version has been released. I doubt this is fixed, but check it out.

You can ask for a bugfix for this here: http://tools.android.com/feedback

PS: you are trying to scroll using the mouse scroll wheel, right? hehe just checking... I say that because just recently I figured out I could scroll in the design mode using the mouse wheel.. duhh haha. I never tried in blueprint mode though.

Fabricio
  • 7,705
  • 9
  • 52
  • 87
  • 1
    Yeah, while using ConstraintLayout. The constraints does not move(the problem) in design mode and nothing moves in blueprint mode. bea1 did not solve it. – Zoe Oct 22 '16 at 21:08