简体   繁体   中英

How to bring Circle Page Indicator to the front in Android

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.

在此输入图像描述

我会先使用RelativeLayout和Pager覆盖整个视图,然后使用parentAlignBottom = true添加指标视图。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM