xcode 如何在 ipad 应用程序中显示网格视图等数据
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11431586/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how to show data like grid view in ipad application
提问by user1495149
Is there any way to show data in the grid view form in ipad application
有没有办法在ipad应用程序的网格视图中显示数据
I want to show the data in grid view in ipad application i have searched a lot some say use custom table view but it is not looking i want full professional i found iOS DataGrid TableView for ipad.
我想在 ipad 应用程序的网格视图中显示数据我搜索了很多有人说使用自定义表格视图但它看起来并不我想要完整的专业我找到了适用于 ipad 的 iOS DataGrid TableView。
Is it ok to use wether it is free or not. And how to implement this if it possible or not. Below is the link of iOS Grid
无论是否免费,都可以使用。以及如何实现这一点(如果可能)。下面是iOS Grid的链接
回答by spaleja
Create custom UITableViewCell as per your requirement and load that cell to table view cell.
根据您的要求创建自定义 UITableViewCell 并将该单元格加载到表格视图单元格。
You can use below sample code to load custom cell with in table's cellForRowAtIndexPath method:
您可以使用以下示例代码在表格的 cellForRowAtIndexPath 方法中加载自定义单元格:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *sCellIdentifier = @"CustomCell"; CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:sCellIdentifier]; if (cell == nil) { NSArray *topLevelObject = [[NSBundle mainBundle] loadNibNamed: @"CustomCell" owner:self options:nil]; for (id currentObject in topLevelObject) { if ([currentObject isKindOfClass:[UITableViewCell class]]) { cell = (CustomCell *)currentObject; break; } } } cell.label1.text = @"label1"; // you can access all controllers of your custom cell like this way cell.selectionStyle = UITableViewCellSelectionStyleNone; return cell; }
回答by Praveen S
How can you not have stumbled upon AQGridView.
你怎么能没有偶然发现AQGridView。
However if you are just interested in styling a cell only, you can implement a custom uitableview cellwhich has few grids and style them according to your requirement.
但是,如果您只对单元格的样式感兴趣,您可以实现一个自定义的 uitableview 单元格,该单元格几乎没有网格并根据您的要求设置样式。
There are many tutorials out there showing how to customize a UITableViewCell
.
有很多教程展示了如何自定义UITableViewCell
.
回答by uudaddy
I used GMGridview, it has an example and basically if you change the cell size, and columns you can make it fit in iPad or iPhone. You can also add UITextField (instead of the default UILabel), if you need to input data. One nice feature is it can scroll.
我使用了 GMGridview,它有一个示例,基本上如果您更改单元格大小和列,您可以使其适合 iPad 或 iPhone。如果需要输入数据,还可以添加 UITextField(而不是默认的 UILabel)。一个不错的功能是它可以滚动。
http://www.gmoledina.ca/projects/gmgridview/
http://www.gmoledina.ca/projects/gmgridview/
Feel free to ask if you have any questions.
如果您有任何问题,请随时提问。
回答by user2453876
We use this one in our application : http://www.ioscomponents.com/. We like it so far.
我们在我们的应用程序中使用这个:http: //www.ioscomponents.com/。到目前为止,我们喜欢它。
回答by Tendulkar
By Using the CustomUITableViewCell you can get the same.i.e Take the UITableviewcell and add the three or four labels to it.Then Pass the data in cellForRowAtIndexPath method.
通过使用 CustomUITableViewCell,您可以获得相同的结果。即获取 UITableviewcell 并为其添加三个或四个标签。然后在 cellForRowAtIndexPath 方法中传递数据。