Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to scroll a ScrollView with a ConstraintLayout in Blueprint Mode?

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>

like image 510
Zoe stands with Ukraine Avatar asked Sep 25 '16 17:09

Zoe stands with Ukraine


People also ask

Can we use ConstraintLayout inside ConstraintLayout?

You can use a ConstraintLayout in an other ConstraintLayout but you need to respect some rules. All direct childs of a ConstraintLayout should have constraint on left,top, right and bottom.

Is CoordinatorLayout scrollable?

Is CoordinatorLayout scrollable? Android Layouts CoordinatorLayout Scrolling Behavior An enclosing CoordinatorLayout can be used to achieve Material Design Scrolling Effects when using inner layouts that support Nested Scrolling, such as NestedScrollView or RecyclerView .

Can we use linear layout in ScrollView?

Can I make a linear layout scrollable? You cannot make a LinearLayout scrollable because it is not a scrollable container. Only scrollable containers such as ScrollView, HorizontalScrollView, ListView, GridView, ExpandableListView can be made scrollable.

Is Gridlayout scrollable?

When you add item to grid layout, depend on Column count Grid layout will start to scroll.


2 Answers

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

like image 64
Multidots Solutions Avatar answered Oct 21 '22 13:10

Multidots Solutions


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]...

like image 36
Samin Avatar answered Oct 21 '22 14:10

Samin