[英]how to show data like grid view in ipad application
有沒有辦法在ipad應用程序中以網格視圖的形式顯示數據
我想在ipad應用程序的網格視圖中顯示數據我已經搜索了很多人說使用自定義表視圖但它不是我想要完全專業我發現iOS DataGrid TableView for ipad。
是否可以使用它是否是免費的。 如果有可能,如何實現這一點。 以下是iOS Grid的鏈接
根據您的要求創建自定義UITableViewCell,並將該單元格加載到表格視圖單元格。
您可以使用下面的示例代碼在表的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; }
你怎么能偶然發現AQGridView 。
但是,如果您只對單元格樣式感興趣,則可以實現一個自定義的uitableview單元格 ,該單元格具有很少的網格並根據您的要求設置樣式。
有許多教程展示了如何自定義UITableViewCell
。
通過使用CustomUITableViewCell,您可以獲得相同的結果。使用UITableviewcell並向其添加三個或四個標簽。然后在cellForRowAtIndexPath方法中傳遞數據。
我使用了GMGridview,它有一個例子,基本上如果你改變單元格大小,你可以讓它適合iPad或iPhone。 如果需要輸入數據,還可以添加UITextField(而不是默認的UILabel)。 一個很好的功能是它可以滾動。
http://www.gmoledina.ca/projects/gmgridview/
如果您有任何疑問,請隨時詢問。
我們在我們的應用程序中使用這個: http : //www.ioscomponents.com/ 。 到目前為止我們都喜歡它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.