Restoring CrimeFragment's Margins?

The first challenge mentions that the margin no longer shows up; however, I’m not seeing any difference between the margins in Chapter 10 and Chapter 11 – anyone else seeing that as well?

Chapter 10 Screenshot

Chapter 11 Screenshot

1 Like

You should see the missing margins on the CrimeFragment screen when you click a crime. I found that simply adding the layout_margin of 16dp to the ViewPager element in activity_crime_pager.xml did the trick to make them come back. Essentially the idea is that the children of ViewPager does not support layout_margin but the ViewPager itself can have layout_margins.

1 Like

I found that this method can also be solved:adding the padding of 16dp to the LinearLayout element in fragment_crime.xml

1 Like

I think you should look the fragment_crime.xml, before using ViewPager, and after using ViewPager.
you can solve the problem by add margin to activity_crime_pager.xml.

<?xml version="1.0" encoding="utf-8"?>


  • android:layout_margin="16dp"

This is how I resolve it, set all the subcomponents to: