TableViewCell не будет отображаться полностью - PullRequest
0 голосов
/ 24 декабря 2018

Я хочу отобразить следующую ячейку по умолчанию, если сообщения недоступны:

enter image description here

На этот раз моя ячейка будет отображаться так:

enter image description here

Я уже установил следующие кодовые строки в viewDidLoad:

tableView.estimatedRowHeight = 150
tableView.rowHeight = UITableView.automaticDimension

В моем cellForRowAt я установил следующеелинии:

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    switch self.postArray.count {

    case 0:
        let cell = tableView.dequeueReusableCell(withIdentifier: "KeineBeiträgeVorhanden")!
        return cell

    default:

    let cell = tableView.dequeueReusableCell(withIdentifier: "DiscoveryCollectionViewCell", for: indexPath) as! DiscoveryCollectionViewCell

Но мой TableViewCell не отображается в нужном размере.Заранее спасибо за помощь!

С Рождеством всех !!!

1 Ответ

0 голосов
/ 24 декабря 2018

Ограничения изображения

( top , centerX ) => to superView , width , height

ограничения надписей

top => to image , ( leading , trailing , bottom ) => to superView 

и .lines = 0

...