2

In my xml hierarchy, I have the root element as a RelativeLayout and then a Scrollview as a child. That ScrollView then has a RelativeLayout with views inside it.

My problem is that I cannot edit the contents in the ScrollView as the design view of Android Studio doesn't show the entire ScrollView. I've tried the toggle viewport render mode button but that doesn't change anything (note: my ScrollView's fillviewport is true as well.

Is there a way I can see everything in my ScrollView where the ScrollView is a child of a RelativeLayout in Android Studio's design view?

Farbod Salamat-Zadeh
  • 19,687
  • 20
  • 75
  • 125

1 Answers1

0

I have this issue as well.

If you have a view hierarchy like...

RelativeLayout (root)  
  --> ScrollView
    --> RelativeLayout
      --> Views (e.g. Buttons, TextViews, etc.)

...I change the above layout to something like...

RelativeLayout (root)
  --> Include

...where my include tag is referencing another XML layout...

ScrollView
  --> RelativeLayout
    --> Views (e.g. Buttons, TextViews, etc.)

In Android Studio's preview, the first XML layout with the <include> tag should show (part of the complete) layout on the device.

The second XML layout, with the ScrollView as its root should show you all of the Views.

As far as I know, there is no other way around this, unfortunately - and I would love to see an alternative solution if there is one.

Farbod Salamat-Zadeh
  • 19,687
  • 20
  • 75
  • 125