Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

987
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda