2017-04-18 25 views
1

我正在学习Xamarin.Android最近,我试图实现页面浏览器与点滑块为我的做法从过去的几天,但未能实现它,我曾经从流行的中心如stackoverflow和github引用了许多解决方案,但没有这样做。 任何人都可以请解释我如何在xamarin.android中实现带点滑块的视图页面。 我附上了一张照片供您参考,这将使您清楚地了解我的要求。 enter image description here如何在Xamarin.Android中使用Dot Sliders实现ViewPagers?

正如你所看到的,他正在使用点滑块滑动页面,我试图这样做。 请解释如何在Xamarin.Android(Native)

回答

0

看看这个示例项目'Android-ViewPagerIndicator Xamarin.Android'。您需要包含库,其中有多个实现来在viewpager上显示指标。

https://github.com/Cheesebaron/ViewPagerIndicator

+0

我一直在使用这种尝试解决这一点,但在安装块包(希望这是你所谈论的库)可以请你帮我块包有一个问题,金块包安装等。 –

+0

我已更新源代码链接。在这里看一下实现示例。您需要在解决方案中包含“Library not LibraryV4”,并通过包含“使用DK.Ostebaronen.Droid.ViewPagerIndicator;”的命名空间进行访问 –

+0

您可以使用下面的代码直接实现点指示器到您的应用程序 –

1

首先定义自己的圈子页面指示符让它成为CirclePageIndicator.cs添加到您的项目(不活动的文件) 使用Android.Content;

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 

using Android.App; 
using Android.Content; 
using Android.OS; 
using Android.Runtime; 
using Android.Views; 
using Android.Widget; 
using Android.Graphics; 
using Android.Support.V4.View; 
using Android.Util; 
using Java.Lang; 
using Java.Interop; 


namespace MyApplication.Droid.Library 
{ 
    public class CirclePageIndicator : View,PageIndicator 
    { 
     const int HORIZONTAL = 0; 
     const int VERTICAL = 1; 
     private float mRadius; 
     private Paint mPaintPageFill; 
     private Paint mPaintStroke; 
     private Paint mPaintFill; 
     private ViewPager mViewPager; 
     private ViewPager.IOnPageChangeListener mListener; 
     private int mCurrentPage; 
     private int mSnapPage; 
     private int mCurrentOffset; 
     private int mScrollState; 
     private int mPageSize; 
     private int mOrientation; 
     private bool mCentered; 
     private bool mSnap; 
     private const int INVALID_POINTER = -1; 
     private int mTouchSlop; 
     private float mLastMotionX = -1; 
     private int mActivePointerId = INVALID_POINTER; 
     private bool mIsDragging; 

     public CirclePageIndicator(Context context) : this(context, null) 
     { 
     } 

     public CirclePageIndicator(Context context, IAttributeSet attrs) : this(context, attrs, Resource.Attribute.vpiCirclePageIndicatorStyle) 
     { 
     } 

     public CirclePageIndicator(Context context, IAttributeSet attrs, int defStyle) : base(context, attrs, defStyle) 
     { 
      //Load defaults from resources 
      var res = Resources; 
      int defaultPageColor = res.GetColor(Resource.Color.default_circle_indicator_page_color); 
      int defaultFillColor = res.GetColor(Resource.Color.default_circle_indicator_fill_color); 
      int defaultOrientation = res.GetInteger(Resource.Integer.default_circle_indicator_orientation); 
      int defaultStrokeColor = res.GetColor(Resource.Color.default_circle_indicator_stroke_color); 
      float defaultStrokeWidth = res.GetDimension(Resource.Dimension.default_circle_indicator_stroke_width); 
      float defaultRadius = res.GetDimension(Resource.Dimension.default_circle_indicator_radius); 
      bool defaultCentered = res.GetBoolean(Resource.Boolean.default_circle_indicator_centered); 
      bool defaultSnap = res.GetBoolean(Resource.Boolean.default_circle_indicator_snap); 

      //Retrieve styles attributes 
      var a = context.ObtainStyledAttributes(attrs, Resource.Styleable.CirclePageIndicator, defStyle, Resource.Style.Widget_CirclePageIndicator); 

      mCentered = a.GetBoolean(Resource.Styleable.CirclePageIndicator_centered, defaultCentered); 
      mOrientation = a.GetInt(Resource.Styleable.CirclePageIndicator_orientation, defaultOrientation); 
      mPaintPageFill = new Paint(PaintFlags.AntiAlias); 
      mPaintPageFill.SetStyle(Paint.Style.Fill); 
      mPaintPageFill.Color = a.GetColor(Resource.Styleable.CirclePageIndicator_pageColor, defaultPageColor); 
      mPaintStroke = new Paint(PaintFlags.AntiAlias); 
      mPaintStroke.SetStyle(Paint.Style.Stroke); 
      mPaintStroke.Color = a.GetColor(Resource.Styleable.CirclePageIndicator_strokeColor, defaultStrokeColor); 
      mPaintStroke.StrokeWidth = a.GetDimension(Resource.Styleable.CirclePageIndicator_strokeWidth, defaultStrokeWidth); 
      mPaintFill = new Paint(PaintFlags.AntiAlias); 
      mPaintFill.SetStyle(Paint.Style.Fill); 
      mPaintFill.Color = a.GetColor(Resource.Styleable.CirclePageIndicator_fillColor, defaultFillColor); 
      mRadius = a.GetDimension(Resource.Styleable.CirclePageIndicator_radius, defaultRadius); 
      mSnap = a.GetBoolean(Resource.Styleable.CirclePageIndicator_snap, defaultSnap); 

      a.Recycle(); 

      var configuration = ViewConfiguration.Get(context); 
      mTouchSlop = ViewConfigurationCompat.GetScaledPagingTouchSlop(configuration); 

     } 

     public void SetCentered(bool centered) 
     { 
      mCentered = centered; 
      Invalidate(); 
     } 

     public bool IsCentered() 
     { 
      return mCentered; 
     } 

     public void SetPageColor(Color pageColor) 
     { 
      mPaintPageFill.Color = pageColor; 
      Invalidate(); 
     } 

     public int GetPageColor() 
     { 
      return mPaintPageFill.Color; 
     } 

     public void SetFillColor(Color fillColor) 
     { 
      mPaintFill.Color = fillColor; 
      Invalidate(); 
     } 

     public int GetFillColor() 
     { 
      return mPaintFill.Color; 
     } 

     public void setOrientation(int orientation) 
     { 
      switch (orientation) 
      { 
       case HORIZONTAL: 
       case VERTICAL: 
        mOrientation = orientation; 
        UpdatePageSize(); 
        RequestLayout(); 
        break; 

       default: 
        throw new IllegalArgumentException("Orientation must be either HORIZONTAL or VERTICAL."); 
      } 
     } 

     public int GetOrientation() 
     { 
      return mOrientation; 
     } 

     public void SetStrokeColor(Color strokeColor) 
     { 
      mPaintStroke.Color = strokeColor; 
      Invalidate(); 
     } 

     public int GetStrokeColor() 
     { 
      return mPaintStroke.Color; 
     } 

     public void SetStrokeWidth(float strokeWidth) 
     { 
      mPaintStroke.StrokeWidth = strokeWidth; 
      Invalidate(); 
     } 

     public float GetStrokeWidth() 
     { 
      return mPaintStroke.StrokeWidth; 
     } 

     public void SetRadius(float radius) 
     { 
      mRadius = radius; 
      Invalidate(); 
     } 

     public float GetRadius() 
     { 
      return mRadius; 
     } 

     public void SetSnap(bool snap) 
     { 
      mSnap = snap; 
      Invalidate(); 
     } 

     public bool IsSnap() 
     { 
      return mSnap; 
     } 

     protected override void OnDraw(Canvas canvas) 
     { 
      base.OnDraw(canvas); 

      if (mViewPager == null) 
      { 
       return; 
      } 
      int count = mViewPager.Adapter.Count; 
      if (count == 0) 
      { 
       return; 
      } 

      if (mCurrentPage >= count) 
      { 
       SetCurrentItem(count - 1); 
       return; 
      } 

      int longSize; 
      int longPaddingBefore; 
      int longPaddingAfter; 
      int shortPaddingBefore; 
      if (mOrientation == HORIZONTAL) 
      { 
       longSize = Width; 
       longPaddingBefore = PaddingLeft; 
       longPaddingAfter = PaddingRight; 
       shortPaddingBefore = PaddingTop; 
      } 
      else 
      { 
       longSize = Height; 
       longPaddingBefore = PaddingTop; 
       longPaddingAfter = PaddingBottom; 
       shortPaddingBefore = PaddingLeft; 
      } 

      float threeRadius = mRadius * 3; 
      float shortOffset = shortPaddingBefore + mRadius; 
      float longOffset = longPaddingBefore + mRadius; 
      if (mCentered) 
      { 
       longOffset += ((longSize - longPaddingBefore - longPaddingAfter)/2.0f) - ((count * threeRadius)/2.0f); 
      } 

      float dX; 
      float dY; 

      float pageFillRadius = mRadius; 
      if (mPaintStroke.StrokeWidth > 0) 
      { 
       pageFillRadius -= mPaintStroke.StrokeWidth/2.0f; 
      } 

      //Draw stroked circles 
      for (int iLoop = 0; iLoop < count; iLoop++) 
      { 
       float drawLong = longOffset + (iLoop * threeRadius); 
       if (mOrientation == HORIZONTAL) 
       { 
        dX = drawLong; 
        dY = shortOffset; 
       } 
       else 
       { 
        dX = shortOffset; 
        dY = drawLong; 
       } 
       // Only paint fill if not completely transparent 
       if (mPaintPageFill.Alpha > 0) 
       { 
        canvas.DrawCircle(dX, dY, pageFillRadius, mPaintPageFill); 
       } 

       // Only paint stroke if a stroke width was non-zero 
       if (pageFillRadius != mRadius) 
       { 
        canvas.DrawCircle(dX, dY, mRadius, mPaintStroke); 
       } 
      } 

      //Draw the filled circle according to the current scroll 
      float cx = (mSnap ? mSnapPage : mCurrentPage) * threeRadius; 
      if (!mSnap && (mPageSize != 0)) 
      { 
       cx += (mCurrentOffset * 1.0f/mPageSize) * threeRadius; 
      } 
      if (mOrientation == HORIZONTAL) 
      { 
       dX = longOffset + cx; 
       dY = shortOffset; 
      } 
      else 
      { 
       dX = shortOffset; 
       dY = longOffset + cx; 
      } 
      canvas.DrawCircle(dX, dY, mRadius, mPaintFill); 
     } 

     public override bool OnTouchEvent(MotionEvent ev) 
     { 

      if (base.OnTouchEvent(ev)) 
      { 
       return true; 
      } 
      if ((mViewPager == null) || (mViewPager.Adapter.Count == 0)) 
      { 
       return false; 
      } 

      var action = ev.Action; 

      switch ((int)action & MotionEventCompat.ActionMask) 
      { 
       case (int)MotionEventActions.Down: 
        mActivePointerId = MotionEventCompat.GetPointerId(ev, 0); 
        mLastMotionX = ev.GetX(); 
        break; 

       case (int)MotionEventActions.Move: 
        { 
         int activePointerIndex = MotionEventCompat.FindPointerIndex(ev, mActivePointerId); 
         float x = MotionEventCompat.GetX(ev, activePointerIndex); 
         float deltaX = x - mLastMotionX; 

         if (!mIsDragging) 
         { 
          if (Java.Lang.Math.Abs(deltaX) > mTouchSlop) 
          { 
           mIsDragging = true; 
          } 
         } 

         if (mIsDragging) 
         { 
          if (!mViewPager.IsFakeDragging) 
          { 
           mViewPager.BeginFakeDrag(); 
          } 

          mLastMotionX = x; 

          mViewPager.FakeDragBy(deltaX); 
         } 

         break; 
        } 

       case (int)MotionEventActions.Cancel: 
       case (int)MotionEventActions.Up: 
        if (!mIsDragging) 
        { 
         int count = mViewPager.Adapter.Count; 
         int width = Width; 
         float halfWidth = width/2f; 
         float sixthWidth = width/6f; 

         if ((mCurrentPage > 0) && (ev.GetX() < halfWidth - sixthWidth)) 
         { 
          mViewPager.CurrentItem = mCurrentPage - 1; 
          return true; 
         } 
         else if ((mCurrentPage < count - 1) && (ev.GetX() > halfWidth + sixthWidth)) 
         { 
          mViewPager.CurrentItem = mCurrentPage + 1; 
          return true; 
         } 
        } 

        mIsDragging = false; 
        mActivePointerId = INVALID_POINTER; 
        if (mViewPager.IsFakeDragging) 
         mViewPager.EndFakeDrag(); 
        break; 

       case MotionEventCompat.ActionPointerDown: 
        { 
         int index = MotionEventCompat.GetActionIndex(ev); 
         float x = MotionEventCompat.GetX(ev, index); 
         mLastMotionX = x; 
         mActivePointerId = MotionEventCompat.GetPointerId(ev, index); 
         break; 
        } 

       case MotionEventCompat.ActionPointerUp: 
        int pointerIndex = MotionEventCompat.GetActionIndex(ev); 
        int pointerId = MotionEventCompat.GetPointerId(ev, pointerIndex); 
        if (pointerId == mActivePointerId) 
        { 
         int newPointerIndex = pointerIndex == 0 ? 1 : 0; 
         mActivePointerId = MotionEventCompat.GetPointerId(ev, newPointerIndex); 
        } 
        mLastMotionX = MotionEventCompat.GetX(ev, MotionEventCompat.FindPointerIndex(ev, mActivePointerId)); 
        break; 
      } 

      return true; 
     } 

     public void SetViewPager(ViewPager view) 
     { 
      if (view.Adapter == null) 
      { 
       throw new IllegalStateException("ViewPager does not have adapter instance."); 
      } 
      mViewPager = view; 
      mViewPager.SetOnPageChangeListener(this); 
      UpdatePageSize(); 
      Invalidate(); 
     } 

     private void UpdatePageSize() 
     { 
      if (mViewPager != null) 
      { 
       mPageSize = (mOrientation == HORIZONTAL) ? mViewPager.Width : mViewPager.Height; 
      } 
     } 

     public void SetViewPager(ViewPager view, int initialPosition) 
     { 
      SetViewPager(view); 
      SetCurrentItem(initialPosition); 
     } 

     public void SetCurrentItem(int item) 
     { 
      if (mViewPager == null) 
      { 
       throw new IllegalStateException("ViewPager has not been bound."); 
      } 
      mViewPager.CurrentItem = item; 
      mCurrentPage = item; 
      Invalidate(); 
     } 

     public void NotifyDataSetChanged() 
     { 
      Invalidate(); 
     } 

     public void OnPageScrollStateChanged(int state) 
     { 
      mScrollState = state; 

      if (mListener != null) 
      { 
       mListener.OnPageScrollStateChanged(state); 
      } 
     } 

     public void OnPageScrolled(int position, float positionOffset, int positionOffsetPixels) 
     { 
      mCurrentPage = position; 
      mCurrentOffset = positionOffsetPixels; 
      UpdatePageSize(); 
      Invalidate(); 

      if (mListener != null) 
      { 
       mListener.OnPageScrolled(position, positionOffset, positionOffsetPixels); 
      } 
     } 

     public void OnPageSelected(int position) 
     { 
      if (mSnap || mScrollState == ViewPager.ScrollStateIdle) 
      { 
       mCurrentPage = position; 
       mSnapPage = position; 
       Invalidate(); 
      } 

      if (mListener != null) 
      { 
       mListener.OnPageSelected(position); 
      } 
     } 

     public void SetOnPageChangeListener(ViewPager.IOnPageChangeListener listener) 
     { 
      mListener = listener; 
     } 

     protected override void OnMeasure(int widthMeasureSpec, int heightMeasureSpec) 
     { 
      if (mOrientation == HORIZONTAL) 
      { 
       SetMeasuredDimension(MeasureLong(widthMeasureSpec), MeasureShort(heightMeasureSpec)); 
      } 
      else 
      { 
       SetMeasuredDimension(MeasureShort(widthMeasureSpec), MeasureLong(heightMeasureSpec)); 
      } 
     } 

     /** 
     * Determines the width of this view 
     * 
     * @param measureSpec 
     *   A measureSpec packed into an int 
     * @return The width of the view, honoring constraints from measureSpec 
     */ 
     private int MeasureLong(int measureSpec) 
     { 
      int result = 0; 
      var specMode = MeasureSpec.GetMode(measureSpec); 
      var specSize = MeasureSpec.GetSize(measureSpec); 

      if ((specMode == MeasureSpecMode.Exactly) || (mViewPager == null)) 
      { 
       //We were told how big to be 
       result = specSize; 
      } 
      else 
      { 
       //Calculate the width according the views count 
       int count = mViewPager.Adapter.Count; 
       result = (int)(PaddingLeft + PaddingRight 
         + (count * 2 * mRadius) + (count - 1) * mRadius + 1); 
       //Respect AT_MOST value if that was what is called for by measureSpec 
       if (specMode == MeasureSpecMode.AtMost) 
       { 
        result = Java.Lang.Math.Min(result, specSize); 
       } 
      } 
      return result; 
     } 

     /** 
     * Determines the height of this view 
     * 
     * @param measureSpec 
     *   A measureSpec packed into an int 
     * @return The height of the view, honoring constraints from measureSpec 
     */ 
     private int MeasureShort(int measureSpec) 
     { 
      int result = 0; 
      var specMode = MeasureSpec.GetMode(measureSpec); 
      var specSize = MeasureSpec.GetSize(measureSpec); 

      if (specMode == MeasureSpecMode.Exactly) 
      { 
       //We were told how big to be 
       result = specSize; 
      } 
      else 
      { 
       //Measure the height 
       result = (int)(2 * mRadius + PaddingTop + PaddingBottom + 1); 
       //Respect AT_MOST value if that was what is called for by measureSpec 
       if (specMode == MeasureSpecMode.AtMost) 
       { 
        result = Java.Lang.Math.Min(result, specSize); 
       } 
      } 
      return result; 
     } 

     protected override void OnRestoreInstanceState(IParcelable state) 
     { 

      try 
      { 
       SavedState savedState = (SavedState)state; 
       base.OnRestoreInstanceState(savedState.SuperState); 
       mCurrentPage = savedState.CurrentPage; 
       mSnapPage = savedState.CurrentPage; 
      } 
      catch 
      { 
       base.OnRestoreInstanceState(state); 
       // Ignore, this needs to support IParcelable... 
      } 
      RequestLayout(); 
     } 

     protected override IParcelable OnSaveInstanceState() 
     { 
      var superState = base.OnSaveInstanceState(); 
      var savedState = new SavedState(superState); 
      savedState.CurrentPage = mCurrentPage; 
      return savedState; 
     } 

     public class SavedState : BaseSavedState 
     { 
      public int CurrentPage { get; set; } 

      public SavedState(IParcelable superState) : base(superState) 
      { 
      } 

      private SavedState(Parcel parcel) : base(parcel) 
      { 
       CurrentPage = parcel.ReadInt(); 
      } 

      public override void WriteToParcel(Parcel dest, ParcelableWriteFlags flags) 
      { 
       base.WriteToParcel(dest, flags); 
       dest.WriteInt(CurrentPage); 
      } 

      [ExportField("CREATOR")] 
      static SavedStateCreator InitializeCreator() 
      { 
       return new SavedStateCreator(); 
      } 

      class SavedStateCreator : Java.Lang.Object, IParcelableCreator 
      { 
       public Java.Lang.Object CreateFromParcel(Parcel source) 
       { 
        return new SavedState(source); 
       } 

       public Java.Lang.Object[] NewArray(int size) 
       { 
        return new SavedState[size]; 
       } 
      } 
     } 
    } 
} 

现在添加PageIndicator.cs文件到您的项目(不活动的文件)

using Android.Support.V4.View; 

namespace MyApplication.Droid.Library 
{ 
    public interface PageIndicator : ViewPager.IOnPageChangeListener 
    { 
     /** 
     * Bind the indicator to a ViewPager. 
     * 
     * @param view 
     */ 
     void SetViewPager(ViewPager view); 

     /** 
     * Bind the indicator to a ViewPager. 
     * 
     * @param view 
     * @param initialPosition 
     */ 
     void SetViewPager(ViewPager view, int initialPosition); 

     /** 
     * <p>Set the current page of both the ViewPager and indicator.</p> 
     * 
     * <p>This <strong>must</strong> be used if you need to set the page before 
     * the views are drawn on screen (e.g., default start page).</p> 
     * 
     * @param item 
     */ 
     void SetCurrentItem(int item); 

     /** 
     * Set a page change listener which will receive forwarded events. 
     * 
     * @param listener 
     */ 
     void SetOnPageChangeListener(ViewPager.IOnPageChangeListener listener); 

     /** 
     * Notify the indicator that the fragment list has changed. 
     */ 
     void NotifyDataSetChanged(); 
    } 

} 

现在下面的文件添加到您的值文件: vpi__styles.xml

<?xml version="1.0" encoding="utf-8" ?> 
<resources> 
    <style name="Widget"></style> 

    <style name="Widget.CirclePageIndicator" parent="Widget"> 
    <item name="centered">@bool/default_circle_indicator_centered</item> 
    <item name="fillColor">@color/default_circle_indicator_fill_color</item> 
    <item name="pageColor">@color/default_circle_indicator_page_color</item> 
    <item name="orientation">@integer/default_circle_indicator_orientation</item> 
    <item name="radius">@dimen/default_circle_indicator_radius</item> 
    <item name="snap">@bool/default_circle_indicator_snap</item> 
    <item name="strokeColor">@color/default_circle_indicator_stroke_color</item> 
    <item name="strokeWidth">@dimen/default_circle_indicator_stroke_width</item> 
    </style> 
</resources> 

vpi__defaults .xml

<?xml version="1.0" encoding="utf-8" ?> 
<resources> 
    <bool name="default_circle_indicator_centered">true</bool> 
    <color name="default_circle_indicator_fill_color">#FFFFFFFF</color> 
    <color name="default_circle_indicator_page_color">#00000000</color> 
    <integer name="default_circle_indicator_orientation">0</integer> 
    <dimen name="default_circle_indicator_radius">3dp</dimen> 
    <bool name="default_circle_indicator_snap">false</bool> 
    <color name="default_circle_indicator_stroke_color">#FFDDDDDD</color> 
    <dimen name="default_circle_indicator_stroke_width">1dp</dimen> 
</resources> 

vpi__colors.xml

<?xml version="1.0" encoding="utf-8" ?> 
<resources> 
    <color name="vpi__background_holo_dark">#ff000000</color> 
    <color name="vpi__background_holo_light">#fff3f3f3</color> 
    <color name="vpi__bright_foreground_disabled_holo_dark">#ff4c4c4c</color> 
    <color name="vpi__bright_foreground_disabled_holo_light">#ffb2b2b2</color> 
</resources> 

vpi__attrs.xml

<?xml version="1.0" encoding="utf-8" ?> 
<resources> 
    <declare-styleable name="ViewPagerIndicator"> 
    <!-- Style of the circle indicator. --> 
    <attr name="vpiCirclePageIndicatorStyle" format="reference"/> 
    </declare-styleable> 
    <declare-styleable name="CirclePageIndicator"> 
    <!-- Whether or not the indicators should be centered. --> 
    <attr name="centered" format="boolean" /> 
    <!-- Color of the filled circle that represents the current page. --> 
    <attr name="fillColor" format="color" /> 
    <!-- Color of the filled circles that represents pages. --> 
    <attr name="pageColor" format="color" /> 
    <!-- Orientation of the indicator. --> 
    <attr name="orientation"> 
     <enum name="horizontal" value="0" /> 
     <enum name="vertical" value="1" /> 
    </attr> 
    <!-- Radius of the circles. This is also the spacing between circles. --> 
    <attr name="radius" format="dimension" /> 
    <!-- Whether or not the selected indicator snaps to the circles. --> 
    <attr name="snap" format="boolean" /> 
    <!-- Color of the open circles. --> 
    <attr name="strokeColor" format="color" /> 
    <!-- Width of the stroke used to draw the circles. --> 
    <attr name="strokeWidth" format="dimension" /> 
    </declare-styleable> 
</resources> 

现在添加以下代码,设计文件。 在这里,你必须注意到MyApplication.Droid.Library是我的名字空间和CirclePageIndicator是我的网页指示文件名,以便与您的

<MyApplication.Droid.Library.CirclePageIndicator 
     android:id="@+id/indicator" 
     android:padding="10dip" 
     android:layout_height="wrap_content" 
     android:layout_width="fill_parent" 
     /> 

现在取代它添加在活动文件中的以下。

using Android.Support.V4.App; 
using MyApplication.Droid.Library; 
//global 
public ViewPager mPager; 
public PageIndicator mIndicator; 
//in on create 
var indicator = FindViewById<CirclePageIndicator>(Resource.Id.indicator); 
      mIndicator = indicator; 
      indicator.SetViewPager(mPager); 
      indicator.SetSnap(true); 

我已经从GitHub的

相关问题