Попробуйте создать UIView и добавить tabBar к этому представлению, и теперь поместите это представление в вашу таблицу. Я попробовал это и это работает,
Так ваша функция cellForRowAtIndexPath будет выглядеть так
- (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];
}
UIView *tempView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 50)];
UITabBar* tabBarView = [[UITabBar alloc] initWithFrame:CGRectMake(0, 0, 320, 50)];
NSArray* tabbarItems = [[NSArray alloc] initWithObjects:[[UITabBarItem alloc] initWithTitle:@"Item1" image:nil tag:1],[[UITabBarItem alloc] initWithTitle:@"Item2" image:nil tag:2],[[UITabBarItem alloc] initWithTitle:@"Item3" image:nil tag:3], nil];
tabBarView.items = tabbarItems;
[tempView addSubview:tabBarView];
[cell addSubview:tempView];
return cell;
}
Так что теперь вместо использования ячейки по умолчанию вы можете настроить ее так, как вам хочется. Также я не рассматривал проблему освобождения памяти, поэтому вам может потребоваться обновить код для освобождения выделенной памяти.