我正在使用SWRevealViewController。 滑出侧栏与子类别
这些是表视图中的一些行。每一行打开一个新的视图。 现在我想在服务点击时显示一些子类别/行,反之亦然。 子类别将像设计,开发,应用等 和这个子类别的每一个打开不同的看法。 我只用了1节。有任何想法吗?
我正在使用SWRevealViewController。 滑出侧栏与子类别
这些是表视图中的一些行。每一行打开一个新的视图。 现在我想在服务点击时显示一些子类别/行,反之亦然。 子类别将像设计,开发,应用等 和这个子类别的每一个打开不同的看法。 我只用了1节。有任何想法吗?
您可以使用包含的UITableView的子类 这里UIPopoverContoller是链接UIPopover https://github.com/alvises/FPPopover 至于UIPopover是为iPad所以在iphone你也会有上述进口第三方库提。
您可以使用包含的UITableView的滑出与子类侧边栏这些MMDrawerController,它有侧栏很不错的动画风格..
https://github.com/mutualmobile/MMDrawerController
我希望它有助于..
不完全是我在找什么。想要它像flipkart等 –
使用以下步骤来实现扩张的细胞
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
cell.textLabel.text=[[self.arForTable objectAtIndex:indexPath.row] valueForKey:@"name"];
[cell setIndentationLevel:[[[self.arForTable objectAtIndex:indexPath.row] valueForKey:@"level"] intValue]];
return cell;
}
这是该方法的TableView DidSelectRow方法展开和折叠行
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
NSDictionary *d=[self.arForTable objectAtIndex:indexPath.row];
if([d valueForKey:@"Objects"]) {
NSArray *ar=[d valueForKey:@"Objects"];
BOOL isAlreadyInserted=NO;
for(NSDictionary *dInner in ar){
NSInteger index=[self.arForTable indexOfObjectIdenticalTo:dInner];
isAlreadyInserted=(index>0 && index!=NSIntegerMax);
if(isAlreadyInserted) break;
}
if(isAlreadyInserted) {
[self miniMizeThisRows:ar];
} else {
NSUInteger count=indexPath.row+1;
NSMutableArray *arCells=[NSMutableArray array];
for(NSDictionary *dInner in ar) {
[arCells addObject:[NSIndexPath indexPathForRow:count inSection:0]];
[self.arForTable insertObject:dInner atIndex:count++];
}
[tableView insertRowsAtIndexPaths:arCells withRowAnimation:UITableViewRowAnimationLeft];
}
}
}
方法扩大和减少细胞
(void)miniMizeThisRows:(NSArray*)ar{
for(NSDictionary *dInner in ar) {
NSUInteger indexToRemove=[self.arForTable indexOfObjectIdenticalTo:dInner];
NSArray *arInner=[dInner valueForKey:@"Objects"];
if(arInner && [arInner count]>0){
[self miniMizeThisRows:arInner];
}
if([self.arForTable indexOfObjectIdenticalTo:dInner]!=NSNotFound) {
[self.arForTable removeObjectIdenticalTo:dInner];
[self.tableView deleteRowsAtIndexPaths:
[NSArray arrayWithObject:[NSIndexPath indexPathForRow:indexToRemove inSection:0]]
withRowAnimation:UITableViewRowAnimationRight];
}
}
}
它显示2错误。没有可见的insertObject,removeObjectIdenticalTo接口。如何解决这些问题 –
使所有数组成为全局变量,并在变量 – Ammar
之前添加@property(nonatomic,strong)。仍然收到错误。 –
很抱歉,但我不想用这种方式和风格。 –