美文网首页iOS学习笔记
PPDragDropBadgeView的使用

PPDragDropBadgeView的使用

作者: 香橙柚子 | 来源:发表于2017-04-01 17:18 被阅读0次

PPDragDropBadgeView是一个badge视图,可以进行拖拽,像QQ5.0中的badge视图。
这里先附上链接:PPDragDropBadgeView

效果图.gif

PPDragDropBadgeView好像不支持从cocopods上pod,只能把它先拉倒项目中去,再来配置相关文件.
以下是官方说明:

  • Checkout PPDragDropBadgeView from github.
  • Copy PPDragDropBadgeView folder to your project.
  • Go to 'TARGET' -> 'Build Phases' -> 'Complile Sources', add compliler flags '-fno-objc-arc' for 'PRTween.m' and 'PRTweenTimingFunctions.m'
    Done.
  • You can also refer to the example project provided by me.

看不懂?没关系,我帮你翻译.
1.从github上查询PPDragDropBadgeView
2.将PPDragDropBadgeView文件夹拖到你的项目当中
3.到'TARGET' -> 'Build Phases' -> 'Complile Sources',添加编译标签'-fno-objc-arc'到 'PRTween.m' 与 'PRTweenTimingFunctions.m' 中

怎么使用PPDragDropBadgeView?
非常简单,用下面的代码片段即可。

PPDragDropBadgeView* badgeView \
= [[PPDragDropBadgeView alloc] initWithSuperView:self.testView
                                location:CGPointMake(0,0)
                                  radius:10.0f dragdropCompletion:^{
                                                 NSLog(@"Drag drop done.");
                                   }];
badgeView.text = @"6";

这个是否支持更多参数的定制呢?
当然,你可以设置“位置”,“半径”,“填充颜色”,“边框宽度”,“边框颜色”。你也可以设置以下我提供的一些属性。

/** The location of badge view. */
@property (nonatomic, assign) CGPoint location;

/** The radius of badge view. */
@property (nonatomic, assign) CGFloat radius;

/** The completion block when drag drop done. */
@property (nonatomic, copy) void(^dragdropCompletion)();

/** The tint color of badge view. Default is red */
@property (nonatomic, strong) UIColor* tintColor;

/** The border color of badge view. Default is clear */
@property (nonatomic, strong) UIColor* borderColor;

/** The border width of badge view. Default is 1.0f */
@property (nonatomic, assign) CGFloat borderWidth;

/** The text of badge view. */
@property (nonatomic, strong) NSString* text;

相关文章

  • PPDragDropBadgeView的使用

    PPDragDropBadgeView是一个badge视图,可以进行拖拽,像QQ5.0中的badge视图。这里先附...

  • iconfont的使用(下载使用)

    1、下载文件 2、在生命周期中引入项目 beforeCreate () { var domModule = ...

  • Gson的使用--使用注解

    Gson为了简化序列化和反序列化的过程,提供了很多注解,这些注解大致分为三类,我们一一的介绍一下。 自定义字段的名...

  • 记录使用iframe的使用

    默认记录一下----可以说 这是我第一次使用iframe 之前都没有使用过; 使用方式: 自己开发就用了这几个属...

  • with的使用

    下面例子可以具体说明with如何工作: 运行代码,输出如下

  • this的使用

    什么是this? this是一个关键字,这个关键字总是返回一个对象;简单说,就是返回属性或方法“当前”所在的对象。...

  • this的使用

    JS中this调用有几种情况 一:纯粹的函数调用 这是函数的最通常用法,属于全局性调用,因此this就代表全局对象...

  • ==的使用

    积累日常遇到的编码规范,良好的编码习惯,持续更新。。。 日常使用==用于判断的时候,习惯性将比较值写前面,变量写后...

  • this的使用

    1.默认绑定,就是函数立即执行。 函数立即执行就是指向window,但是如果是node环境,就是指向全局conso...

  • %in% 的使用

    写在前面:From 生信技能书向量难点之一:%in% 难点 (1)== 与 %in% 的区别== 强调位置,x和对...

网友评论

    本文标题:PPDragDropBadgeView的使用

    本文链接:https://www.haomeiwen.com/subject/ndaiottx.html