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 User Input Introducing ImageViews

Andrew Izquierdo
Andrew Izquierdo
3,212 Points

When trying to select the layout_width for the "titleImageView", I do not see the option of "match_parent". Why?

I followed the steps in the video. But when I got to setting the layout_width and the layout_height, i do not see the option of "match_parent" like it shows in the video.

The only options i have are: "none", "match constraint", and "wrap content".

why do I not see "match parent" ?

will manually inputting 368dp and 495dp for the width and height give me the same results? Thanks for the help!

Hasancan Boga
Hasancan Boga
4,642 Points

same, it only shows match_constraint and when i select that it defaults to 0dp.

3 Answers

I have found a way around this.

If you set the 'layout_width' and 'layout_height' for 'titleImageView' both to 'match_constraint' using the design window. And then go into the text window and find where it has added 'android:layout_width="0dp"' and 'android:layout_height="0dp"'. Then change the '0dp' values to 'match_parent'. Then check to make sure that 'android:scaleType' is set to 'centerCrop'.

That should all work as it is shown in the video. I have no idea why the match_parent option isn't displayed like in the video. It might be a version problem. I am running Android Studio 3.0.1

Alan Kuo
Alan Kuo
7,697 Points

solved it using your method, thanks

Jeremiah Shore
Jeremiah Shore
31,168 Points

Thanks, this worked. Having the same issue in Android Studio 3.2.1.

3.6 is working by your help, thanks! 👾 👍🏽

Worked for me as well. Android Studio version 3.5.1

Noah Schochet
Noah Schochet
611 Points

I think it has to do with changes between the newer version of Android studio and the one he is using in the video. Don't worry about it, it ends up being resolved in the next video. Just watch the next video and it will make sense.