[翻译] PPDragDropBadgeView

简介:

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

 

目录
相关文章
|
11天前
|
弹性计算 关系型数据库 微服务
基于 Docker 与 Kubernetes(K3s)的微服务:阿里云生产环境扩容实践
在微服务架构中,如何实现“稳定扩容”与“成本可控”是企业面临的核心挑战。本文结合 Python FastAPI 微服务实战,详解如何基于阿里云基础设施,利用 Docker 封装服务、K3s 实现容器编排,构建生产级微服务架构。内容涵盖容器构建、集群部署、自动扩缩容、可观测性等关键环节,适配阿里云资源特性与服务生态,助力企业打造低成本、高可靠、易扩展的微服务解决方案。
1230 5
|
10天前
|
机器学习/深度学习 人工智能 前端开发
通义DeepResearch全面开源!同步分享可落地的高阶Agent构建方法论
通义研究团队开源发布通义 DeepResearch —— 首个在性能上可与 OpenAI DeepResearch 相媲美、并在多项权威基准测试中取得领先表现的全开源 Web Agent。
1213 87
|
10天前
|
云栖大会
阿里云云栖大会2025年9月24日开启,免费申请大会门票,速度领取~
2025云栖大会将于9月24-26日举行,官网免费预约畅享票,审核后短信通知,持证件入场
1796 13
|
20天前
|
人工智能 运维 安全
|
3天前
|
资源调度
除了nrm-pm,还有哪些工具可以管理多个包管理器的源?
除了nrm-pm,还有哪些工具可以管理多个包管理器的源?
234 127
|
4天前
|
前端开发
Promise的then方法返回的新Promise对象有什么特点?
Promise的then方法返回的新Promise对象有什么特点?
177 2