Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.