CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.

FXStarsView 1.0.2

FXStarsView 1.0.2

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Jan 2016

Maintained by zfx5130.



  • By
  • thomas

效果如下

安装

2.手动安装

  1.下载FXStarsView文件夹内的所有内容。
  2.将FXStarsView内的源文件添加(拖放)到你的工程。
  3.导入FXStarsView.h。

使用方式

    #import "FXStarsView.h"

    YBStarsView starsView =
    [[YMStarsView alloc] initWithFrame:self.view.bounds];
    self.starsView.delegate = self;
    self.starsView.dateSource = self;
    [self.view addSubview:self.starsView];
    [self.starsView showStars];

Delegate方法

/**
 *  the stars will be Around the rect nearby, if you set the center rect, the arcrandom star will be arcrandom round the center rect near. if you not set, default is the view center,UIEdgeInsets(10, 10, 10, 10).
 *
 *  @param starsView
 *
 *  @return the center rect
 */
- (CGRect)centerRectForStarsView:(YMStarsView *)starsView;

/**
 *  the stars padding ,the stars will be set near +/- padding with the center rect circle,
    default is +/- 20.0f.Horizontal
 *
 *  @param starsView
 *
 *  @return the centerX padding
 */
- (CGFloat)horizontalPaddingForStarsView:(YMStarsView *)starsView;

/**
 *  the stars padding y ,the stars will be set near +/- padding with the center rect,Vertical
 *
 *  @param starsView starsView
 *
 *  @return the centerY padding
 */
- (CGFloat)verticalPaddingForStarsView:(YMStarsView *)starsView;

DataSource

/**
 *  will return the default value if unset, the default stars radius is 4.0f,
 *  if set array, will be arcrandom set radius with the array element.
 *
 *  @param starsView
 *
 *  @return radiues
 */
- (NSArray<NSNumber *> *)starRadiusesForStarsView:(YMStarsView *)starsView;

/**
 *  will return the default value if unset, default stars count is 20.
 *
 *  @param starsView starsView
 *
 *  @return star count
 */
- (NSUInteger)starCountForStarsView:(YMStarsView *)starsView;