How to bring Circle Page Indicator to the front in Android
-
11-06-2021 - |
문제
I have a view pager gallery and a circle page indicator in the bottom of the view. I want to bring page indicator in front of the view pager and make it transparent if it's possible as like in iphone image gallery. Do you have any idea how to do it ?
SOLUTION:
Here is the xml code as the solution. Thanks to @sanna
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#000000">
<android.support.v4.view.ViewPager
android:id="@+id/gallery_view"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
/>
<com.viewpagerindicator.CirclePageIndicator
android:id="@+id/indicator"
android:padding="10dip"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_alignParentBottom="true"
/>
</RelativeLayout>
And here is the new appearance of my gallery.
해결책
I would use RelativeLayout with your Pager covering the whole view first and then add the indicator view with parentAlignBottom=true.
제휴하지 않습니다 StackOverflow