Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
545
Questions about the layout
posted

Hi, i have a gridview with dynamic number of rows and columns:

the left part is a fixed column (up to the separator blue) and is composed of a custom cell with an imageview and a label

I have not used the IGGridViewDataSourceHelper because I have a complex data structure, but I have implemented all the methods of the protocol datasource in my view controller.

I have not assigned a theme to the grid, but I configured the graphics with the available properties on the gridview, I have no problem if you need to implement a custom theme.

code:

    IGGridView* gridView = [[IGGridView alloc] initWithFrame:CGRectZero style:IGGridViewStyleDefault];
    [self.view addSubview:gridView];
    [gridView setTranslatesAutoresizingMaskIntoConstraints:NO];
    gridView.rowHeight = 70;
    gridView.rowSpacing = 0;
    gridView.rowSeparatorHeight = .5;
    gridView.headerTextColor = [UIColor blackColor];
    gridView.headerHeight = 60;
    gridView.headerBackgroundColor = [UIColor defaultHeaderColor];
    gridView.headerFont = [UIFont boldSystemFontOfSize:15];
    gridView.fixedLeftColumnSeparatorColor = [UIColor appleBlue];
    gridView.fixedLeftColumnSeparatorWidth = 1;
    gridView.rowSeparatorColor = [UIColor lightGrayColor];

    //Constraints
    NSDictionary *views = NSDictionaryOfVariableBindings(gridView);
    [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[gridView]|" options:0 metrics:nil views:views]];
    [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[gridView]|" options:0 metrics:nil views:views]];

questions:

1) I can insert a separator between the header of the columns and the grid? as for the separator of the fixed column


2) how to center the text in the header (the label "Prodotto", etc ...)? I use the default header that generates the grid with
- (NSString *) GridView (IGGridView *) GridView titleForHeaderInColumn: (NSInteger) column
- (NSString *) GridView (IGGridView *) GridView titleForHeaderInFixedLeftColumn: (NSInteger) column


3) how to insert a separator between columns? Should I make a grid like excel


4) I can not set a minimum width of the columns, if I have many text compresses as shown:

when the columns reach the minimum width, the grid should become scrollable