码迷,mamicode.com
首页 > 其他好文 > 详细

[翻译] PPDragDropBadgeView

时间:2015-05-01 22:24:58      阅读:253      评论:0      收藏:0      [点我收藏+]

标签:

PPDragDropBadgeView

技术分享

https://github.com/smallmuou/PPDragDropBadgeView

PPDragDropBadgeView is a badge view which able to drag and drop. Just like QQ 5.0 badge view.

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

技术分享

 

  • Support iOS 5.0+ ARC 支持 iOS5.0+ 以及ARC

Configure

  • Checkout PPDragDropBadgeView from github. 从github上查询PPDragDropBadgeView
  • Copy PPDragDropBadgeView folder to your project. 将PPDragDropBadgeView文件夹拖到你的项目当中
  • Go to ‘TARGET‘ -> ‘Build Phases‘ -> ‘Complile Sources‘, add compliler flags ‘-fno-objc-arc‘ for ‘PRTween.m‘ and ‘PRTweenTimingFunctions.m‘ 到‘TARGET‘ -> ‘Build Phases‘ -> ‘Complile Sources‘,添加编译标签‘-fno-objc-arc‘到 ‘PRTween.m‘ 与 ‘PRTweenTimingFunctions.m‘ 中
  • Done.

You can also refer to the example project provided by me.

你也可以直接参考这个我写的例子。

Usage

  • Q: How to use PPDragDropBadgeView? 怎么使用PPDragDropBadgeView?
  • A: Very simple, you only follow the down code. 非常简单,用下面的代码片段即可。

    PPDragDropBadgeView* badgeView = [[PPDragDropBadgeView alloc] initWithSuperView:self.testView
                                        location:CGPointMake(0,0)
                                          radius:10.0f dragdropCompletion:^{
                                                         NSLog(@"Drag drop done.");
                                           }];
    badgeView.text = @"6";
    
  • Q: Does it can be customized? 这个是否支持更多参数的定制呢?

  • A: Of course, you can set "location", "radius", "tintColor", "borderWidth", "borderColor". You can see the propertys provided by me. 当然,你可以设置“位置”,“半径”,“填充颜色”,“边框宽度”,“边框颜色”。你也可以设置以下我提供的一些属性。

    /** 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;
    

History

  • v1.0 (March 30, 2015)
    • First release.

License

The code follows MIT Lisence.

Contact

If you have any questions with use it or found some bugs, you can mail to me. I will get back to you in time. The follow is my email address: lvyexuwenfa100@126.com

 

[翻译] PPDragDropBadgeView

标签:

原文地址:http://www.cnblogs.com/YouXianMing/p/4471203.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!