I have an Activity
that includes a ListFragment
in the activity's xml file...
<fragment
android:id="@+id/shoppingListNamesFragment"
android:name="com.example.ShoppingListNamesFragment"
android:layout_below="@id/shoppingListsTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
I would like to put a border around this fragment. I have tried adding this to the above XML...
android:background="@drawable/white_dashed_border"
android:padding="14dp"
android:layout_margin="14dp"
...but it doesn't create the border (whereas it does create a border if I add those 3 lines to the xml, for example, to a LinearLayout).
How do I add a border to the ListFragment (ideally by using xml)?
PS - There is a similar question here which suggests adding a parent layout, but I want to avoid that if possible.