Ocultar encabezado NSTableView?


¿Cómo oculto un encabezado NSTableView completamente, para que no ocupe espacio?

Author: Kristina Brooks, 2010-08-18

3 answers

En Interface Builder, seleccione la vista de tabla, abra el inspector de atributos (alt-command-4) y desmarque la casilla de verificación "Encabezados" en la sección "Columnas".

 86
Author: Brian Webster,
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-02-23 09:10:49

También puede establecer el headerView programáticamente sin subclase

[tableView setHeaderView:nil];
 34
Author: finnsson,
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
2011-03-14 21:50:29

Para hacer esto programáticamente, puede subclase NSTableView (o cualquier clase hija NSTableView) y devolver nil para la variable headerView:

@interface AppTableView : NSTableView {

}

@end

@implementation AppTableView

- (NSTableHeaderView *)headerView{
    return nil;
}

@end
 8
Author: Scott Harwell,
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
2010-10-27 21:04:35