CATextLayer的简单介绍
来源:互联网 发布:网络上桂枝什么意思 编辑:程序博客网 时间:2024/06/04 18:27
import UIKit
class ViewController: UIViewController {
var colorTextLayer:CATextLayer!
var toplayer:CALayer!
var bottomlayer:CALayer!
override func viewDidLoad() {
super.viewDidLoad()
self.p_initLayers()
// Do any additional setup after loading the view, typically from a nib.
}
func p_initLayers(){
toplayer = CALayer()
toplayer.frame =CGRect(x: 50, y:0, width: 95, height:40)
toplayer.backgroundColor =UIColor.blueColor().CGColor
bottomlayer = CALayer()
bottomlayer.frame =CGRect(x: 0, y:100, width: self.view.frame.size.width, height:40)
bottomlayer.backgroundColor =UIColor.magentaColor().CGColor
bottomlayer.addSublayer(toplayer)
self.view.layer.addSublayer(bottomlayer)
colorTextLayer =CATextLayer()
colorTextLayer.string ="我会区域变色哦我会区域变色哦我会区域变色哦域变色哦我会区域变色哦"
// colorTextLayer.foregroundColor = UIColor.yellowColor().CGColor
colorTextLayer.frame =bottomlayer.bounds
colorTextLayer.fontSize =20
colorTextLayer.alignmentMode =kCAAlignmentCenter
colorTextLayer.frame =bottomlayer.bounds
bottomlayer.mask =colorTextLayer
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
- CATextLayer的简单介绍
- CATextLayer的学习
- CATextLayer
- CATextLayer
- 正确设置CATextLayer的Font
- Core Animation的CATextLayer的使用
- iOS 中 CAtextLayer 类的妙用 -
- CATextLayer设置字体的正确姿势
- 解决CATextLayer,换行和文字不清晰的问题
- 解决CATextLayer绘制出来的字体模糊问题
- iOS quartzCore第八章—— CATextLayer的运用
- CATextLayer与CAGradientLayer实现文字渐变的动画效果
- 使用CATextLayer
- CATextLayer使用
- CATextLayer类
- sniffer的简单介绍
- JSValidation的简单介绍
- P2P的简单介绍
- Linux glibc幽灵(GHOST)漏洞检测及修复方案
- Linux YUM或RPM修复 glibc幽灵(GHOST)漏洞
- VIM命令模式与输入模式切换
- iOS常用系统调用
- 成功人士的秘密:早上起床会做的五件事
- CATextLayer的简单介绍
- Windows Update 升级补丁 错误 代码80072EE2
- linux kvm虚拟机使用
- 2719: [Violet 4]银河之星
- 使用iLO远程管理HP服务器
- RTNETLINK answers: File exists错误解决方法
- Redhat 6.3配置免费yum源(测试平台使用)
- mysql 存储过程-字符串判断查询
- JavaMail学习笔记——JavaMail 接收邮件