【问题标题】:How to bring Circle Page Indicator to the front in Android如何在 Android 中将圆形页面指示器置于最前面
【发布时间】:2012-05-29 07:23:38
【问题描述】:

我在视图底部有一个视图寻呼机库和一个圆形页面指示器。如果可能的话,我想将页面指示器放在视图寻呼机前面并使其透明,就像在 iphone 图片库中一样。你知道怎么做吗?

解决方案:

这里是 xml 代码作为解决方案。感谢@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>

这是我画廊的新外观。

【问题讨论】:

  • 能否分享一下imageview的代码??
  • @kgandroid Image View 在 ViewPager 中。没什么特别的,就是全屏ImageView。

标签: android android-viewpager indicator


【解决方案1】:

我会先将 RelativeLayout 与您的 Pager 一起使用覆盖整个视图,然后使用 parentAlignBottom=true 添加指示器视图。

【讨论】:

  • 感谢您的回答。它工作得很好。您还可以将我的编辑视为解决方案。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-05-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多