博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

iOS Tips

Posted on 2012-02-18 16:30  sytjs  阅读(136)  评论(0)    收藏  举报

1. Obj_C 中结构体的使用和释放

TestStruct *newTestStruct(int value)
{
    TestStruct *ret = malloc(sizeof(TestStruct));
    ret->value = value;
    return ret;
}

TestStruct *x = newTestStruct(3);
free(x); // release the space

 

2. UISwitch显示为橘黄色的背景(文档未记录)。

@interface UISwitch (extended)
- (void) setAlternateColors:(BOOL) boolean;

@end

 

3. CALayer( the model class for layer-tree objects)

  每个UIView都有一个根CALayer,其所有的(绘制-draw)视觉效果(大部分属性都可animate)都是在这个层上进行的。CALayer可影响UIView的外观特性有:层的size, backgroundColor, content(image or content drawed by Core Graphics); cornerRect, shadow, transform etc.

Reference: https://developer.apple.com/library/ios/#documentation/GraphicsImaging/Reference/CALayer_class/Introduction/Introduction.html

https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CoreAnimation_guide/Articles/AnimatingLayers.html

http://sue602.blog.163.com/blog/static/31495307201103034736509/

  + 自绘图形demo

 

4.  iphone的动画效果类型及实现方法(UIView层面,CATransition)

  + The following properties of the UIView class are animatable:

Reference : http://www.voland.com.cn/the-effect-of-the-type-and-implement-for-iphone