Swift-Translucid图片文字融合控件

图片做文字背景的效果,挺常见,但用原生的 UILabelUITextView 搞起来不太方便。Swift-Translucid 就是为了这事儿的,库不大,用法也简单,专门给 iOS 和 macOS 做视觉增强的。

Translucid 的核心点是让文字和图片自然融合,不用你手动去调半天透明度、阴影、对比度这些视觉参数。比如欢迎页那种半透明文字叠在背景图上的效果,用它分分钟搞定。

功能上,像是图像混合文字遮罩自动换文字颜色都有。直接一句话总结:你只管写文案,它帮你搞定背景融合和可读性。

集成方式也原始但高效——把Ekhoo-Translucid-8d91979的源码拖进项目就行,用TranslucidTextView替换原本的UILabel,设置好backgroundImagetextfont之类的就能用了。

实用场景?蛮多的,像新闻 App 的标题区域、带图的宣传语组件、带有动效的页。配合 Core Graphics 或自定义滤镜还能玩出更多花样。

如果你平时要文字+图像相关的 UI,不妨把 Translucid 加进工具箱,省事不少,效果也更稳。如果你对 Swift 的图形感兴趣,也推荐看看它是怎么实现背景混合逻辑的。

zip
swift-Translucid将一张图片作为文本背景的轻量级库采用swif开发.zip 预估大小:19个文件
folder
Ekhoo-Translucid-8d91979 文件夹
file
Translucid.podspec 609B
file
.gitignore 635B
folder
Example 文件夹
folder
Resources 文件夹
file
demo.gif 4.28MB
file
stars 1.15MB
file
Starjedi.ttf 45KB
file
Info.plist 1KB
file
DemoViewController.swift 1KB
folder
Base.lproj 文件夹
file
LaunchScreen.storyboard 2KB
file
AppDelegate.swift 985B
folder
Assets.xcassets 文件夹
folder
AppIcon.appiconset 文件夹
file
Contents.json 585B
file
LICENSE 1KB
folder
TranslucidFramework 文件夹
file
TranslucidFramework.h 563B
file
Info.plist 806B
file
README.md 2KB
folder
Translucid.xcodeproj 文件夹
folder
xcshareddata 文件夹
folder
xcschemes 文件夹
file
TranslucidFramework.xcscheme 3KB
folder
project.xcworkspace 文件夹
file
contents.xcworkspacedata 155B
file
project.pbxproj 20KB
folder
Source 文件夹
file
Translucid.swift 3KB
folder
Asset 文件夹
file
translucid.png 95KB
zip 文件大小:5.45MB