UITableViewCell 中图片的宽度改变为点击 [英] The width of images in UITableViewCell changes to the click

查看:30
本文介绍了UITableViewCell 中图片的宽度改变为点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

@nathan 这是我的整个控制器.我的问题是,当我单击 tableview 单元格时,图像大小会更改并变得太长.我不知道如何修复尺寸,我尝试了一切.为了进行 URL 解析,我使用了 NSXMLParser,而我使用 SDWebImage 将图像加载到单元格中.

@nathan this is my entire controller. My problem is that when I click a tableview cell, the image size is changed and becomes too long. I can not figure out how to fix the size, I tried everything. To do URL parsing, I used NSXMLParser, while I used SDWebImage to load images into cells.

当我按下一个元素时,它的大小会发生变化.像这样:

When I press an element its size changes. Like this:

如何解决?

推荐答案

这似乎是一个内容模式问题.将imageView的contentMode设置为aspectFit/aspectFill(看你要实现什么)

That seems like a content mode issue. Set the imageView's contentMode to aspectFit/aspectFill (depends on what you want to achieve)

这篇关于UITableViewCell 中图片的宽度改变为点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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