Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build an Interactive Story App Finishing the User Interface Introducing ScrollViews

Sachin Jayaram
Sachin Jayaram
5,461 Points

When I drag the imageView and textView they aren't visible like how its seen in the video.

I do not see the image and text once i drag them into the linearlayout.

2 Answers

Sachin Jayaram
Sachin Jayaram
5,461 Points

I figured it out. I had app:layout_constraintTop_toTopOf="@+id/storyImageView" instead of app:layout_constraintTop_toTopOf="parent"

Casper Demeersseman
Casper Demeersseman
597 Points

Hey, I had the same problem. Your answer fixed it perfectly! Yet could you tell me why we made this mistake and why it cause the textView and imageView to vanish?

Sachin Jayaram
Sachin Jayaram
5,461 Points

The reason it happens is cause at 2:06 in the video when you try to constraint the scrollView to the top of parent, it actually gets constrained to the imageView since that is what is present directly below the scrollView. If you want to go around it, just pull the image down and then constraint the scrollView to the top. That should fix it in the design column.

In my case, I had the bottom constraint of the ScrollView wrong.

I had it set to "parent":

app:layout_constraintBottom_toTopOf="parent"

not choice1Button:

app:layout_constraintBottom_toTopOf="@+id/choice1Button"

So the story image and text views looked like they were in the right places. But their contents were not visible. All I saw was empty white boxes.