teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

追記

2016/04/05 15:14

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -11,4 +11,7 @@
11
11
  ```
12
12
  このimageは配列で読み込んでいるのですが、画像の大きさがバラバラなので、はみ出して見えます。
13
13
  これらの画像をリサイズして一定にしたいです。
14
- わかる方よろしくお願いします。
14
+ わかる方よろしくお願いします。
15
+
16
+ ![イメージ説明](31861c8c714c96190e1d33260cd3e476.png)
17
+ 以上のように、元画像サイズのまま表示されるため、右側がそろわず、バラバラになってしまいます

1

書き方の修正

2016/04/05 15:14

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -1,13 +1,14 @@
1
1
  SwiftのtableViewにおいてimageの大きさを一定にする方法について質問します。
2
2
 
3
+ ```lang-Swift
3
- Swift func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
4
+ func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
4
5
  let cell = UITableViewCell(style: .Default,reuseIdentifier: "Q")
5
6
  cell.textLabel!.text = place[indexPath.row]
6
7
  cell.imageView!.image = img[indexPath.row]
7
8
  cell.textLabel!.font = UIFont(name: "HirakakuProN-W6",size: 13)
8
9
  return cell
9
10
  }
10
-
11
+ ```
11
12
  このimageは配列で読み込んでいるのですが、画像の大きさがバラバラなので、はみ出して見えます。
12
13
  これらの画像をリサイズして一定にしたいです。
13
14
  わかる方よろしくお願いします。