ViewController.swift普通の設定です。 rowHeight には UITableViewAutomaticDimension を設定して自動で高さを計算するようにしています。 CustomCell.xibCellのレイアウトです。適当に右寄せで画像を表示してAutoLayoutを設定します。UIImageViewのContentModeは AspectFit にしてあります。 AutoLayoutは左側を >= で設定して、あとは、 Aspect Ratio を設定してます。この比率の制約はIBOutletとしてコードから使用します。その他は普通にマージンを設定しています。 CustomCell.swiftCellのコードです。IBOutletでUIImageViewと比率の制約を関連付けます。 画像ライブラリにはNukeを使ってますが、他のライブラリでも似たような感じに
◆マックスむらいチャンネル https://www.youtube.com/user/TheMaxMurai ◆コラボ動画 https://youtu.be/ZSHM26wrZWQ ◆チャンネル登録はこちら↓ http://www.youtube.com/user/hikakintv?sub_confirmation=1 ◆新曲雑草MV https://www.youtube.com/watch?v=UyV9ud-akdw ◆ツイッター↓ https://twitter.com/hikakin ◆インスタグラム https://instagram.com/hikakin/ ◆ヒカキンゲームズ http://www.youtube.com/hikakingames ◆ビートボックス動画のHIKAKINチャンネル↓ http://www.youtube.com/HIKAKIN
So far I have been just using text labels within cells that should auto-size themselves. I usually put constraints to all of the edges (content view or neighbors) and add the following lines to my viewDidLoad(): // 190.0 is the actual height of my custom cell (see next image) in the storyboard containing a label and a randomly sized UIImageView tableView.estimatedRowHeight = 190.0 tableView.rowHei
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く