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
Sam Hayward
11,673 PointsView not filling screen
In the 'Opening a Webpage Within the App' part of the blog reader app, when dragging a webview onto the newly created activity (exactly into the top left pixel) . It does not fill the screen, even with fill width and fill height toggled. There is still a small grey margin (which does appear when running the app on my galaxy s3) I do hope I havn't just made some stupid mistake, any feedback would be much appreciated. Thanks =)
3 Answers
Liam Peters
8,792 PointsHi, I haven't taken the course, but it sounds like you either have a margin set on the web view or some padding on it's parent view (Like a Linear layout). Make sure "android:layout_margin" isn't set on the webview and make sure "android:padding" isn't set on the parent view (if there is one!) Hope this helps!
Sam Hayward
11,673 PointsThis didn't seem to happen on Ben's video, so i assume padding isn't automatically added on his automatically generated relative layouts, due to a different version i suppose? or am i missing something here? This was actually happening on my other views but i didn't really realise as the padding appears white and not grey on those views. The padding was put there automatically and is defined in the res directory under values > dimens.xml:
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
Anyway thanks again =)
Ben Jakuben
Treehouse TeacherHi Sam, sounds like you're catching the newer default padding. Check out this older forum post: https://teamtreehouse.com/forum/fullscreen
Sam Hayward
11,673 PointsThanks Ben! Apologies for bringing up something that's been dealt with; i thought i searched for it but clearly not well enough! :p
Ben Jakuben
Treehouse TeacherNo worries! Our search functionality has been a little wonky since our redesign launched. I have had trouble finding things, too, and I know exactly what I'm looking for! :)
Sam Hayward
11,673 PointsSam Hayward
11,673 PointsIt turns out there was padding on the parent view! Thankyou!