¡@

Home 

2014/10/15 ¤U¤È 10:04:55

iphone Programming Glossary: catextlayer

How can I add overlay text on a video, then re-encode it?

http://stackoverflow.com/questions/10190333/how-can-i-add-overlay-text-on-a-video-then-re-encode-it

CGRectMake 0 0 videoSize.width videoSize.height parentLayer addSublayer videoLayer parentLayer addSublayer aLayer CATextLayer titleLayer CATextLayer layer titleLayer.string @ Text goes here titleLayer.font CFBridgingRetain @ Helvetica titleLayer.fontSize.. videoSize.height parentLayer addSublayer videoLayer parentLayer addSublayer aLayer CATextLayer titleLayer CATextLayer layer titleLayer.string @ Text goes here titleLayer.font CFBridgingRetain @ Helvetica titleLayer.fontSize videoSize.height..

How to create a UILabel or UITextView with bold and normal text in it?

http://stackoverflow.com/questions/12776741/how-to-create-a-uilabel-or-uitextview-with-bold-and-normal-text-in-it

uitextview share improve this question Use NSAttributedString to set multiple font text in a single label use CATextLayer to render it just #import NSAttributedString Attributes.h and then implement it like this NSString string1 @ Hi NSString.. attributedStringWithString string2 attr2 setFont UIFont boldSystemFontOfSize 20 attr1 appendAttributedString attr2 CATextLayer textLayer CATextLayer layer layer.string attr1 layer.contentsScale UIScreen mainScreen scale Your_text_label .layer textLayer.. string2 attr2 setFont UIFont boldSystemFontOfSize 20 attr1 appendAttributedString attr2 CATextLayer textLayer CATextLayer layer layer.string attr1 layer.contentsScale UIScreen mainScreen scale Your_text_label .layer textLayer OR if you want to..

Bold & Non-Bold Text In A Single UILabel?

http://stackoverflow.com/questions/3586871/bold-non-bold-text-in-a-single-uilabel

UIButton UITextView UITextField and maybe others now support attributed strings which means we don't need to create CATextLayer s as our recipient for attributed strings. Furthermore to make the attributed string we don't need to play with CoreText.. PS Above code it should work but it was brain compiled. I hope it is enough Old Answer for iOS5 and below Use a CATextLayer with an NSAttributedString much lighter and simpler than 2 UILabels. iOS 3.2 and above Example. Don't forget to add QuartzCore.. NSString stringWithFormat @ @ @ prefix dateString df release Create the text layer on demand if _textLayer _textLayer CATextLayer alloc init _textLayer.font UIFont boldSystemFontOfSize 13 .fontName not needed since `string` property will be an NSAttributedString..

iPad: Animate UILabels color changing

http://stackoverflow.com/questions/3944416/ipad-animate-uilabels-color-changing

The answers to this question give some good workarounds without using Core Animation. If you don't mind using a CATextLayer instead of a UILabel then the color and the scaling in your example can be animated like this #import QuartzCore QuartzCore.h.. need to add QuartzCore framework to project as well as the import . void animateTextLayer CGFloat animationDuration 5 CATextLayer textLayer CATextLayer layer textLayer setString @ Hello World textLayer setForegroundColor UIColor purpleColor .CGColor.. framework to project as well as the import . void animateTextLayer CGFloat animationDuration 5 CATextLayer textLayer CATextLayer layer textLayer setString @ Hello World textLayer setForegroundColor UIColor purpleColor .CGColor textLayer setFontSize..

Vector like drawing for zoomable UIScrollView

http://stackoverflow.com/questions/5538394/vector-like-drawing-for-zoomable-uiscrollview

like drawing for zoomable UIScrollView I have a zoomable UIScrollView with some CATextLayer s and simple CALayer s in it. They get rendered fine but the problem is when they are zoomed they become blurry. Even if.. would be my options to get my text not blurry when the view is zoomed Should I use another thing enable something in CATextLayer CALayer Any idea is welcomed I am using CALayer s because as suggested in documentation CALayer s are lighter than UIViews.. rasterizes the text before the scale up occurs that's why it's so blurry. You only need to fix one property of your CATextLayer contentsScale to get a higher quality render after zooming. Implement this UIScrollViewDelegate method void scrollViewDidEndZooming..