How to set padding between ViewPager pages while keeping the page full-width
It seems that more recent releases of the support package (since revision 5) have added support for margins between pages of ViewPager
via setPageMargin()
and setPageMarginDrawable()
.
How to show viewpager with margin or different design
Try Change margin to padding
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="40dp"
android:paddingRight="40dp"
tools:context="com.tpayerapp.Fragments.PayPalFragment">
<ImageView
android:id="@+id/imageView25"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="false"
android:layout_alignParentRight="false"
android:layout_alignParentTop="false"
android:layout_alignWithParentIfMissing="false"
android:layout_centerHorizontal="false"
android:layout_centerInParent="true"
android:background="@color/colorAccent"
app:srcCompat="@drawable/paypal" />
How to set margin with ViewPager filling the parent
I guess the layout with the rounded corners is the layout your viewpager calls, try to create a linearlayout inside your current layout and add the margins inside this one.
I hope this helps you, or it may inspire you a solution.
How to remove the space between two fragments in android view pager?
hey this code helps you :)
final int pageMargin = (int) TypedValue.applyDimension( TypedValue.COMPLEX_UNIT_DIP, 8, getResources() .getDisplayMetrics());
viewPager.setPageMargin(pageMargin);
Related Topics
Changing Values from Cursor Using Simplecursoradapter
How to Pick Image for Crop from Camera or Gallery in Android 7.0
Custom Filtering Arrayadapter in Listview
Android - Open Target _Blank Links in Webview with External Browser
How to Access The Second Mic Android Such as Galaxy 3
How to Force Audio Through The Speakers When Headphones Are Plugged In
Runtime Exception Android O with Boot_Completed
How to Replace a String for a Buildvariant with Gradle in Android Studio
Get Context of Test Project in Android Junit Test Case
Android: Refreshing The Gallery After Saving New Images
Uninstall App Silently with System Privileges
Gradle: Add Dependency for a Specific Flavour of The Library
How to Overlap Items in Linearlayoutmanager - Recyclerview (Like Stacking Cards)
Selecting Contact from Autocomplete Textview
How to Find Memory Leak Class/Activity in Android