JOEmojiableBtn

加入收藏
已有 5 人收藏

介绍:
    使用方法:

    首先可以运行示例DEMO,小编在Xcode7.3下依据Swift的新特性修改了下代码,在DEMO中可以看到项目的示例目录。

    

    安装:

    只需要在 Podfile 中添加:pod "JOEmojiableBtn"

    

    示例:

    1. 基本栗子

    创建了有基本的反应样式的 JOEmojiableBtn :

    let btn = JOEmojiableBtn(frame: CGRectMake(40,200,50,50))

    btn.delegate = self

    btn.backgroundColor = UIColor.greenColor()

    btn.dataset = [

     JOEmojiableOption(image: "img_1", name: "dislike"),

     JOEmojiableOption(image: "img_2", name: "broken"),

     JOEmojiableOption(image: "img_3", name: "he he"),

     JOEmojiableOption(image: "img_4", name: "ooh"),

     JOEmojiableOption(image: "img_5", name: "meh!"),

     JOEmojiableOption(image: "img_6", name: "ahh!")

    ]

    self.view.addSubview(btn)

测试环境:
  [Code4App]编译测试
效果图:
  • iOS / iPhone / iPad 使用方法:<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;首先可以运行示例DEMO,小编在Xcode7.3下依据Swift的新特性修改了下代码,在DEMO中可以看到项目的示例目录。<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;安装:<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;只需要在 Podfile 中添加:pod "JOEmojiableBtn"<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;示例:<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;1. 基本栗子<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;创建了有基本的反应样式的 JOEmojiableBtn :<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;let btn             = JOEmojiableBtn(frame: CGRectMake(40,200,50,50))<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;btn.delegate        = self<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;btn.backgroundColor = UIColor.greenColor()<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;btn.dataset         = [<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;    JOEmojiableOption(image: "img_1", name: "dislike"),<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;    JOEmojiableOption(image: "img_2", name: "broken"),<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;    JOEmojiableOption(image: "img_3", name: "he he"),<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;    JOEmojiableOption(image: "img_4", name: "ooh"),<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;    JOEmojiableOption(image: "img_5", name: "meh!"),<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;    JOEmojiableOption(image: "img_6", name: "ahh!")<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;]<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;self.view.addSubview(btn)
代码评论:
登录后方可评论

  
  • 暂无评论