PHP短视频源码,实现背景的镂空文字

简介: PHP短视频源码,实现背景的镂空文字
[self addSubview:self.underDescribeTitleLabel];
    [self addSubview:self.describeTitleLabel];

-(void)setRank:(NSUInteger) rank
{
    _rank = rank;
    UIColor *strokeColor = BGColorHex(C69116);
    NSUInteger tempRank = rank/10+1;
    if(0 == rank)
    {
        tempRank = 0;
    }
    else if(rank >= 100)
    {
        tempRank = 10;
    }
    switch (tempRank) {
        case 0:
            strokeColor = BGColorHex(A1A1A1);
            break;
        case 1:
            strokeColor = BGColorHex(FE7241);
            break;
        case 2:
            strokeColor = BGColorHex(FF9802);
            break;
        case 3:
            strokeColor = BGColorHex(FFBF01);
            break;
        case 4:
            strokeColor = BGColorHex(CBDC3C);
            break;
        case 5:
            strokeColor = BGColorHex(699E38);
            break;
        case 6:
            strokeColor = BGColorHex(26A99C);
            break;
        case 7:
            strokeColor = BGColorHex(05A8F3);
            break;
        case 8:
            strokeColor = BGColorHex(4F6BEA);
            break;
        case 9:
            strokeColor = BGColorHex(663CB5);
            break;
        case 10:
            strokeColor = BGColorHex(E9407B);
            break;
            
        default:
            break;
    }
    
    NSString *rankStr = [NSString stringWithFormat:@"%lu", rank];
    NSString *str = [NSString stringWithFormat:@"fron%@", rankStr];
    NSUInteger fillCharacterCount = 4;
    NSMutableAttributedString *textAttributedString = [[NSMutableAttributedString alloc] initWithString:str];
    [textAttributedString addAttribute:NSForegroundColorAttributeName value:[UIColor clearColor] range:NSMakeRange(0, fillCharacterCount)];
    [textAttributedString addAttribute:NSStrokeColorAttributeName value:strokeColor range:NSMakeRange(fillCharacterCount, rankStr.length)];
    [textAttributedString addAttribute:NSStrokeWidthAttributeName value:@4.0 range:NSMakeRange(fillCharacterCount, rankStr.length)];
   [textAttributedString addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12.f] range:NSMakeRange(0, fillCharacterCount)];
   [textAttributedString addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:12.f] range:NSMakeRange(fillCharacterCount, rankStr.length)];
    self.describeTitleLabel.attributedText = textAttributedString;
    [self.describeTitleLabel updateLayout];
    
    textAttributedString = [[NSMutableAttributedString alloc] initWithString:str];
    [textAttributedString addAttribute:NSForegroundColorAttributeName value:[UIColor clearColor] range:NSMakeRange(0, fillCharacterCount)];
    [textAttributedString addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor] range:NSMakeRange(fillCharacterCount, rankStr.length)];
    [textAttributedString addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12.f] range:NSMakeRange(0, fillCharacterCount)];
    [textAttributedString addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:12.f] range:NSMakeRange(fillCharacterCount, rankStr.length)];
    self.underDescribeTitleLabel.attributedText = textAttributedString;
    [self.underDescribeTitleLabel updateLayout];
    
    
    NSString *filename = [NSString stringWithFormat:@"lv%lu", tempRank];
    self.decribeImageView.image = [UIImage imageNamed:filename];
}

以上就是 PHP短视频源码,实现背景的镂空文字相关的代码,更多内容欢迎关注之后的文章

目录
相关文章
|
10天前
|
前端开发 安全 Java
响应式企业网站源码JavaL/PHP带后台管理​:Bootstrap HTML5模板
本指南深度解析基于Java/PHP双引擎与Bootstrap HTML5的响应式企业官网开发全流程,涵盖架构设计、后台管理、数据库规范、安全加固及云原生部署,助力企业实现品牌展示、业务转化与运营闭环,推动数字化转型。
|
10天前
|
小程序 PHP 图形学
热门小游戏源码(Python+PHP)下载-微信小程序游戏源码Unity发实战指南​
本文详解如何结合Python、PHP与Unity开发并部署小游戏至微信小程序。涵盖技术选型、Pygame实战、PHP后端对接、Unity转换适配及性能优化,提供从原型到发布的完整指南,助力开发者快速上手并发布游戏。
|
12天前
|
存储 小程序 Java
热门小程序源码合集:微信抖音小程序源码支持PHP/Java/uni-app完整项目实践指南
小程序已成为企业获客与开发者创业的重要载体。本文详解PHP、Java、uni-app三大技术栈在电商、工具、服务类小程序中的源码应用,提供从开发到部署的全流程指南,并分享选型避坑与商业化落地策略,助力开发者高效构建稳定可扩展项目。
|
2月前
|
小程序 安全 关系型数据库
专业打造一款圈子源码软件系统 / 后端 PHP 搭建部署一样实现利益化
本教程详解基于PHP后端与Uni-app的小程序开发全流程,涵盖技术选型、环境搭建、源码导入、接口对接及功能实现。采用Laravel/Symfony框架,结合MySQL/PostgreSQL数据库,使用WebSocket实现实时通信,并集成IM SDK实现音视频聊天。前端使用Uni-app开发,支持跨平台运行。教程包含完整部署流程与安全优化方案,助力快速搭建高性能、安全稳定的小程序系统。
175 5
|
2月前
|
存储 缓存 安全
php项目源码加密之Zend Guard Loader加密的代码解密可能性很小-优雅草卓伊凡
php项目源码加密之Zend Guard Loader加密的代码解密可能性很小-优雅草卓伊凡
115 2
|
2月前
|
运维 安全 数据可视化
采用PHP+Vue技术架构的不良事件管理系统(源码)
本系统为医院安全(不良)事件管理工具,支持快速上报、流程化处理与多维度分析,助力识别风险、优化管理。采用PHP+Vue技术架构,功能涵盖事件上报、追踪整改、数据统计及PDCA改进等。
118 0
|
5月前
|
PHP
基于PHP开发的资源库系统源码
基于PHP开发的资源库系统源码
116 13
|
6月前
|
前端开发 算法 NoSQL
前端uin后端php社交软件源码,快速构建属于你的交友平台
这是一款功能全面的社交软件解决方案,覆盖多种场景需求。支持即时通讯(一对一聊天、群聊、文件传输、语音/视频通话)、内容动态(发布、点赞、评论)以及红包模块(接入支付宝、微信等第三方支付)。系统采用前后端分离架构,前端基于 UniApp,后端使用 PHP 框架(如 Laravel/Symfony),配合 MySQL/Redis 和自建 Socket 服务实现高效实时通信。提供用户认证(JWT 集成)、智能匹配算法等功能,助力快速上线,显著节约开发成本。
158 1
前端uin后端php社交软件源码,快速构建属于你的交友平台
|
5月前
|
安全 搜索推荐 PHP
一款轻量级的PHP链接发布页面源码
一款轻量级的PHP链接发布页面源码
109 6