小编Kyr*_*dis的帖子

如何以编程方式添加 imageView 宽度/高度?

我如何更改width/heightUIImageView. 我有很多不同的图片width/height,我希望它们以 imageView 的大小显示。

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    let cell = tableView.dequeueReusableCell(withIdentifier: "Cell")
    let city = nicosiaPlaces [indexPath.row]
    cell?.textLabel?.text = city
    cell?.imageView?.image = UIImage(named: city)
    cell?.imageView?.frame.size = CGSize(width: 10, height: 10)
    return cell!
}
Run Code Online (Sandbox Code Playgroud)

我想让这行代码工作:

cell?.imageView?.frame.size = CGSize(width: 10, height: 10)
Run Code Online (Sandbox Code Playgroud)

uitableview uiimageview image-size swift

0
推荐指数
1
解决办法
6778
查看次数

NSLOG如何在一行中显示多个变量

我有三个 NSString 变量 NSString *text1; NSString *text2; NSString *text3; NSLog(@"%@"text1, text2, text3);
这仅显示 text1 变量 我如何在 NSLog 中将所有变量显示在一行中?

谢谢

objective-c nslog

-2
推荐指数
1
解决办法
1294
查看次数