如何设置cell.imageview框架 [英] How to set the cell.imageview frame

查看:94
本文介绍了如何设置cell.imageview框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有表格视图,其中
我希望我的图像视图重置框架

I have table view in which I want my Image view to reset the frame

我使用了以下代码:

[[cell imageView] setFrame:CGRectMake(0,0,32,32)];

但没有任何工作

请让我知道如何调整默认的imageView部分

Please let me know how to resize the default imageView section

谢谢

推荐答案

最好的方法是将 - (void)layoutSubviews 添加到您的单元子类中,如下所示:

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);
}

这篇关于如何设置cell.imageview框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆