现在的位置: 首页 > 综合 > 正文

iOS开发Tips4

2014年08月29日 ⁄ 综合 ⁄ 共 898字 ⁄ 字号 评论关闭
  • 修改cell.imageView.frame大小
  • UIView旋转
  • Objective-C中的Literals
  • 打印Rect, Size, Point

---------------------------------------------------------------------

修改cell.imageView.frame大小

The best way is to add -
(void)layoutSubviews
 to your cell subclass like this:

- (void)layoutSubviews {
    [super layoutSubviews];
    self.imageView.frame = CGRectMake(0.0f , 0.0f, 32.0f, 32.0f);
}


---------------------------------------------------------------------
UIView旋转

float rotateAngle = M_PI;    
 CGAffineTransform transform =CGAffineTransformMakeRotation(rotateAngle);    
 view.transform = transform;  

---------------------------------------------------------------------
Objective-C中的Literals

---------------------------------------------------------------------

打印Rect, Size, Point

    NSLog(@"%@", NSStringFromCGRect(rect));
    NSLog(@"%@", NSStringFromCGSize(size));
    NSLog(@"%@", NSStringFromCGPoint(point));

抱歉!评论已关闭.