mirror of
https://gh-proxy.org/https://github.com/klinsmaya/dashjim.github.com.git
synced 2026-11-08 01:16:54 +08:00
加入ctrundelegate 的回调
This commit is contained in:
@@ -161,6 +161,25 @@ callbacks的结构体为CTRunDelegateCallbacks,主要是包含一些回调函
|
||||
|
||||
{% highlight objc %}
|
||||
|
||||
void RunDelegateDeallocCallback( void* refCon ){
|
||||
|
||||
}
|
||||
|
||||
CGFloat RunDelegateGetAscentCallback( void *refCon ){
|
||||
NSString *imageName = (NSString *)refCon;
|
||||
return [UIImage imageNamed:imageName].size.height;
|
||||
}
|
||||
|
||||
CGFloat RunDelegateGetDescentCallback(void *refCon){
|
||||
return 0;
|
||||
}
|
||||
|
||||
CGFloat RunDelegateGetWidthCallback(void *refCon){
|
||||
NSString *imageName = (NSString *)refCon;
|
||||
return [UIImage imageNamed:imageName].size.width;
|
||||
}
|
||||
|
||||
|
||||
- (void)drawRect:(CGRect)rect
|
||||
{
|
||||
CGContextRef context = UIGraphicsGetCurrentContext();
|
||||
|
||||
Reference in New Issue
Block a user