ios 关于如何调整cell.imageView中的ImageView大小及位置

来源:互联网 发布:笔记本预装linux 编辑:程序博客网 时间:2024/05/12 03:31

在- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath方法中这样设置uiimageview大小及位置


[cell.imageView setImage:[UIImage imageNamed:@"doorcell.png"]];     


  CGSize itemSize = CGSizeMake(35, 35);

        
        
        UIGraphicsBeginImageContext(itemSize);
        
        
        CGRect imageRect = CGRectMake(0.0, 0.0, itemSize.width, itemSize.height);
        
        
        [cell.imageView.image drawInRect:imageRect];
        
        
        cell.imageView.image = UIGraphicsGetImageFromCurrentImageContext();
        
        UIGraphicsEndImageContext();


0 0
原创粉丝点击