¿Hay alguna forma de ocultar los indicadores de desplazamiento en UIScrollView?


Tengo un caso de uso donde esos indicadores perturban la interacción del usuario. ¿Puedo subclasificar y anular un método o hacer algo similar para eliminar los indicadores de desplazamiento de la vista de desplazamiento?

Author: Pang, 2009-05-05

6 answers

Establece las propiedades showsHorizontalScrollIndicator y showsVerticalScrollIndicator de UIScrollView a NO.

[tableView setShowsHorizontalScrollIndicator:NO];
[tableView setShowsVerticalScrollIndicator:NO];

Documentación-UIScrollView

 241
Author: retainCount,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-02-15 06:58:24

//Para UITableView-Objective-C

tbl.showsHorizontalScrollIndicator = NO;
tbl.showsVerticalScrollIndicator = NO;

//Para UITableView-SWIFT 3.0

tbl.showsHorizontalScrollIndicator = false
tbl.showsVerticalScrollIndicator = false

//Para UIScrollView-Objective-C

scrl.showsHorizontalScrollIndicator = NO;
scrl.showsVerticalScrollIndicator = NO;

//Para UIScrollView-SWIFT

scrl.showsHorizontalScrollIndicator = false
scrl.showsVerticalScrollIndicator = false

Cambio de XIB o storyboard

introduzca la descripción de la imagen aquí

 39
Author: Bhavesh Nayi,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-05-28 13:38:12

Para aquellos que buscan hacer esto en Swift.

self.tableView.showsHorizontalScrollIndicator = false
self.tableView.showsVerticalScrollIndicator = false
 13
Author: davidrayowens,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-09-01 06:15:00

Para UIScrollView en Swift

scrollView?.showsHorizontalScrollIndicator = false
scrollView?.showsVerticalScrollIndicator = false
 8
Author: mattyU,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-06-02 16:45:17

Estas son sus propiedades de desplazamiento UITableView:

[YourTableView setShowsHorizontalScrollIndicator:NO];
[YourTableView setShowsVerticalScrollIndicator:NO];

Estas son sus propiedades de desplazamiento UIScrollView:

[YourScroll setShowsHorizontalScrollIndicator:NO];
[YourScroll setShowsVerticalScrollIndicator:NO];
 4
Author: Darshan Kunjadiya,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-05-10 11:29:10

Extensión Swift 3 para UIScrollView y UITableView:

import Foundation

extension UIScrollView {
    func hideIndicators() {
        showsHorizontalScrollIndicator = false
        showsVerticalScrollIndicator = false
    }
}
 1
Author: Roman Barzyczak,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-04-24 07:23:15