1 2 3 4 5 |
var img_:UIImage = UIImage(named:"img.png") var imageView_:UIImageView = UIImageView(image:img_) imageView_.frame = CGRectMake(0, 0, 100, 44) self.view.addSubview(imageView_) |
名前に変数を使う場合
1 2 |
var n_:Int = 10 var image_:UIImage = UIImage(contentsOfFile:n_ + ".png")) |