xenofex / multicolumntableviewforios Goto Github PK
View Code? Open in Web Editor NEWImplemented a multi-column table view based on the UITableView for iOS
Implemented a multi-column table view based on the UITableView for iOS
Hi,
I have a table view with 5 columns and 20 rows. Is there a method to scroll to a particular row/column (e.g. scroll to column 3 and row 15)?
Great grid. I am new to iOS and was looking for something like this.
I did fine any issue though. If you open the grid with the iPad in portait mode, then rotate the device the first column header does not get redrawn correctly.
Hi Xenofex,
I have been playing around with the grid and have been trying to find an easy way to not use sections.
What I have come up with, which I think needs some work is something like this:
In your example, I have modified viewDidLoad in MultiColumnTableViewController.m to look like this:
- (void)viewDidLoad
{
[super viewDidLoad];
numberOfColumns = 5;
numberOfRows = 30;
numberOfSections = 1;
colWidth = 240.0f;
headerHeight = 100;
headerWidth = colWidth;
data = [[NSMutableArray alloc] initWithCapacity:numberOfRows];
for (int i = 0; i < numberOfRows; i++)
{
NSMutableArray *rowArray = [NSMutableArray arrayWithCapacity:numberOfColumns];
for (int j = 0; j < numberOfColumns; j++) {
[rowArray addObject:text];
}
//[sectionArray addObject:rowArray];
[data addObject:rowArray];
}
tblView = [[EWMultiColumnTableView alloc] initWithFrame:CGRectInset(self.view.bounds, 5.0f, 5.0f)];
// tblView.sectionHeaderEnabled = YES;
// tblView.cellWidth = 100.0f;
// tblView.boldSeperatorLineColor = [UIColor blueColor];
// tblView.normalSeperatorLineColor = [UIColor blueColor];
// tblView.boldSeperatorLineWidth = 10.0f;
// tblView.normalSeperatorLineWidth = 10.0f;
tblView.dataSource = self;
tblView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
[self.view addSubview:tblView];
}
and modified this method to just return the number of rows…
- (NSInteger)tableView:(EWMultiColumnTableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [data count];
}
Is there an easier and more readable way to not use sections and just have pure rows in the grid? I couldn't really see any other way with out extending the API a bit...
Also, is there a more dynamic way to calculate the width/height of the columns rather than hard coding them? Sorry I am new to iOS programming.
Thanks!
Hi. I want to put a UIgesture to the rows that lines are written (not section). I mean "Line: (x,x)" ones. to do it, i have to get the index of the row which is tapped two times... How can i do it?
When i get "indexPath.row" it returns me, the last index of the value that appears on the screen, then if i scroll it down, the index changes again to another number and the value of lines are mixing all... can u suggest me anything about that? Thanks
I want the user to select a row, and it stays selected, for better visualisation...
Thank you
I used this library, looks good, but there is a problem, I could not get the didSelectRow, as I need row data on selection so that I can edit that row. any suggestion plz
Hi,
Good Work & an excellent controller.
Right the application works fine, one wish to drag one whole column to another one.But , is it possible to move the single cell or selected from one Column to other column or row ?
I didn't find any delegate method which can trace the column & the Row for moving the cells herewith.
Also, I am now to Github, if there is something then pls let me know.
Thanks,
I have 2 columns that are horizontally scrollable next to the left stationary column. Scrolling vertically is not smooth. I've tried setting all labels opaque, as well as the tableview itself. Even leaving out the content in the cells it is slow.
Could it have something to do with the UIViews being created for each cell occurrence?
Hi, when request reloadData the cell UiView will not recreate only header dimension will recreate, so if i want change column number, cells data are wrong positioned also wrong dimension.
Thanks
Hi,
Great work.
Is it possible to programatically scroll the table to a particular column?
I have a MultiColumnTableViewViewController inside other controller.
If try to change resize this controller, the behavior is wrong.
For example,
With this part of code:
MultiColumnTableViewViewController* tabla = [[MultiColumnTableViewViewController alloc] initWithNibName:@"MultiColumnTableViewViewController" bundle:nil];
tabla.view.frame = CGRectMake(20, 20, 600, 400);
[child1.view addSubview:tabla.view];
and this part:
MultiColumnTableViewViewController* tabla = [[MultiColumnTableViewViewController alloc] initWithNibName:@"MultiColumnTableViewViewController" bundle:nil];
tabla.view.frame = CGRectMake(20, 20, 601, 400);
[child1.view addSubview:tabla.view];
the size of MultiColumnTableViewViewController change radically.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.