我在自定义UITableViewCell
我要添加的UITableView
内容,UITableViewCell
所以有任何控制器可以做同样的事情
这是我想在项目中添加的图像
这是可扩展的UITableView
,其中在单击表格内的第一行并展开按钮后.
因此,如果有任何类似的控制器可用,请建议我.
提前致谢.
我想在它的点击上展开tableview单元格.有一个tableview,其中两个单元格是可扩展的,而另一些则不是.当我点击可扩展单元格时,它需要显示它下面的单元格,再次点击它应该隐藏.下面有一张图片来定义这个.
如何实现此功能,请指导以上内容.提前致谢.
我有一个UITableView并看到了这种效果,并希望为我们的followind数据实现它:
menu_header
menu_subheader
* item
* item
menu_subheader
* item
* item
* item
Run Code Online (Sandbox Code Playgroud)
基本上,我想只显示标题和子标题,然后当用户单击其中一个子标题时,它会显示项目(最好是在动画块中)并适当地向下或向上调整其他单元格.像这样:
是否有预制组件可以做到这一点?想一想,似乎我想将这些项目单元格设置为隐藏.我已经看过这个https://github.com/peterpaulis/StaticDataTableViewController但看起来它不适用于动态数据.看起来这应该很简单.有关如何完成这项工作的任何想法?理想情况下,我希望它能够在您单击它时插入数据,然后如果您单击另一个子标题,请关闭另一个并添加到该子标题.
我正在做一个需要扩展单元格的应用程序,以显示更多细节.我使用了自定义单元格并将它们添加到UItableview中.当我点击单元格时,它会动画很好并且向下移动,当我再次单击它时,它会上升,这是通过更改单元格的高度来完成的.实际的自定义单元格大小比我通常显示的单元格大.当我点击细胞时,显示整个细胞.我遇到的唯一问题是数据溢出.未选择单元格时,应隐藏这些数据.只有在选择时才应显示这些数据.
我提到了不同的文章,尝试改变颜色设置绑定对我不起作用.我有同样的问题在这个问题iphone uitablecellview溢出问,尝试了答案,但它没有奏效.
我需要的是如何在未扩展时隐藏自定义单元格的底部部分,并在扩展时显示它!...
这些是我的屏幕截图
当它被加载
当我点击一个单元格]
当我点击第二个单元格时
当我点击已经展开的单元格时这些是我用过的代码剪辑....
// Declaring the SearchResultTable.
CGRect filterFrame = CGRectMake(0,31, 320, 400);
self.searchResultTable = [[UITableView alloc] initWithFrame:filterFrame];
self.searchResultTable.dataSource = self;
self.searchResultTable.delegate = self;
self.searchResultTable.backgroundColor = [UIColor whiteColor];
self.searchResultTable.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
self.searchResultTable.separatorColor = [UIColor lightGrayColor];
[self.view addSubview:self.searchResultTable];
//Adding cells
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"ExpandedSearchResultTableCell";
ExpandedSearchResultTableCell *cell = (ExpandedSearchResultTableCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell.contentView.clipsToBounds = YES;
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"ExpandedSearchResultTableCell" owner:self …
Run Code Online (Sandbox Code Playgroud) 我想UITableView
用动画扩展/折叠我的部分.我使用了这个答案,如果我打电话,它现在有效self.tableView.reloadData()
.但是我希望当我点击我的自定义UITableView
标题时,该部分的单元格应该向下/向上滑动一个漂亮的动画.我试图使用self.tableView.beginUpdates()
和self.tableView.endUpdates()
,但我收到此错误:
Invalid update: invalid number of rows in section 0. The number of rows contained in an
existing section after the update (8) must be equal to the number of rows contained in that
section before the update (0), plus or minus the number of rows inserted or deleted from
that section (0 inserted, 0 deleted) and plus or minus the number of rows moved into or out …
Run Code Online (Sandbox Code Playgroud) ios ×6
uitableview ×6
iphone ×2
objective-c ×2
swift ×2
animation ×1
custom-cell ×1
dropdown ×1
ios-4.2 ×1
ios7 ×1
xcode ×1