自定义tableview单元格图像拉伸

时间:2018-01-27 13:45:26

标签: swift xcode uitableview uiimageview

本网站上的第一篇文章,请原谅任何错误。

我在tableview中的自定义单元格中遇到问题,图像设置为宽度345,高度:200和200远离边框,单元格大小为400宽度。但是当它启动时一切都很好,除了图像以大约1000宽度而不是200宽度显示。

Runtime screenshot

图像内容模式设置为缩放以填充,剪辑到边界。但是尝试了方面适合,同样的问题。

extension SearchViewController: UITableViewDataSource {


func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int
{
    return 10
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
{
    let cell = tableView.dequeueReusableCell(withIdentifier:"searchCell", for: indexPath)
    return cell
}

constraint image

0 个答案:

没有答案
相关问题