UItableViewCell imageview 在选择时改变 [英] UItableViewCell imageview changing on select

查看:23
本文介绍了UItableViewCell imageview 在选择时改变的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 webcache 加载 facebook 用户列表,它工作得非常好.在您选择其中一个单元格之前,它似乎会更改内容模式,或者更有可能更改 uiimageview 框架的大小,但基于图片的实际大小.为清楚起见,这里有一些屏幕

I am loading in a list of facebook users using webcache and it works fantastically. Until you select one of the cells then it seems to either change the content mode, or more likely it changes the size of the uiimageview frame, but based on the actual size of the picture. for clarity here are some screens

这里加载了http://img.photobucket.com/albums/v246/homojedi/Screenshot20120727114807.png

并且在选择一些图像时,您可以看到它们似乎跳到了原始方面.http://img.photobucket.com/albums/v246/homojedi/Screenshot20120727114827.png

and on selection of some of the images as you can see they seem to jump to their original aspect. http://img.photobucket.com/albums/v246/homojedi/Screenshot20120727114827.png

正如预期的那样,如果我将它们滚动到屏幕外并返回到它们,它们会恢复到开始时的状态.

as expected if i scroll them off screen and back to them they restore to what they were at the start.

这令人费解.我唯一没有尝试的是子类化 uitableView 并在那里设置其布局子视图.除此之外还有什么我可以做的吗?

It's baffling. The only thing i have not attempted is subclassing the uitableView and setting its layout subview there. short of that is there anything else i can do?

请求代码

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    // typically you need know which item the user has selected.
    // this method allows you to keep track of the selection
    _indexPath = indexPath;

    [_indexPath retain];
}

推荐答案

我遇到了和你完全一样的问题,我解决了

I've face exactly the same issue as you,and I fix

问题是由于您将 imageView 命名为imageView"

the issue is cause by you named your imageView "imageView"

不知道为什么

如果您将 imageView 名称更改为m_imageView"

if you change your imageView name like "m_imageView"

问题已解决

一切都与命名有关!

这篇关于UItableViewCell imageview 在选择时改变的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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