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


No 'match_parent' option, only 'match_constraint' which gives it the value of 0dp.

For layout_width on the titleImageView I am only given the options; none, match_constraint and wrap_content.

There is no option for match_parent. When selecting match_constraint, the closest option to match_parent, it sets the value to 0dp.

The layout_width options for ConstraintLayout do include a match_parent option, but this is set as default and does not affect the titleImageView.

I am using Android Studio 3.0.1

1 Answer

Don't worry.

I have found a way around this.

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

Is there is a better way to do this please let me know.