Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

992
Visualizações
Add space below last element of Table view in swift

I need to add some extra space after the last element in the table view cell.

In android reccycler view, the same thing can be achieved by

android:paddingBottom="8dp"
 android:clipToPadding="false"

Table view last item

over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

You need to add insets to your tableView . Try the following code

let insets = UIEdgeInsets(top: 0, left: 0, bottom: 50, right: 0)
tableView.contentInset = insets
over 4 years ago · Santiago Trujillo Relatório

0

Add datasource and delegate for your tableview and utilize following delegate methods: - heightForFooterInSection & viewForFooterInSection

// set view for footer
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
    let footerView = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.size.width, height: 40)) // assuming 40 height for footer.
    footerView.backgroundColor = <Some Color>
    return footerView
}

// set height for footer
func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
    return 40
}
over 4 years ago · Santiago Trujillo Relatório

0

When you use content inset for add padding it may create some issue, when no data available in tableView.

Try this

Simply and the view in a tableFooterView for the padding in the bottom of tableView.

//Add Padding in the bottom of tableview

let view = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.size.width, height: 20))
view.backgroundColor = UIColor.white
tableView.tableFooterView = view
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda