美文网首页
翻牌字符串

翻牌字符串

作者: 轻云绿原 | 来源:发表于2019-08-02 16:59 被阅读0次

    PPFFlipChar

    效果

    翻牌字符串

    引用

    pod 'PPFFlipStringView', '~> 0.0.1'
    

    怎么用

    let v = PPFFlipStringView(frame: CGRect(x: 50, y: 50, width: 300, height: 60), number: numberOfChars, charSpace: 4, direction: .horizontal)
    // 设置字体
    v.setTextFont(UIFont.systemFont(ofSize: 60))
    // 设置字的颜色
    v.setTextColor(UIColor.white)
    // 设置字的背景颜色
    v.setTextBackgroundColor(UIColor.brown)
    // 设置字符里面空隙的距离
    v.setSpaceInsideChar(2)
                
    view.addSubview(v)
    
    /// 变换字符串
    v.setText("Abde3", force: false)
    

    相关文章

      网友评论

          本文标题:翻牌字符串

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