user3477026 user3477026 -4 years ago 147
Android Question

Create margin on Fragment with Widget

This is an example of my activity with element fixed and automatic margin:

enter image description here

But when use fragment:
enter image description here

Its possibile to set margin on fragment?

Answer Source

In the fragment container in your activity xml, set padding to the container. In your specific case, set it to the ViewPager.

example:

android:padding="10dp"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download