Tag: uitableview

iOS SearchDisplayController防止桌面背景颜色变化(背景保持灰色)

这可能是iOS 7中的一个错误:我使用storyboard在我的tableview控制器中的search栏和search显示控制器中拖动。 之后,我的tableview的背景颜色被改变了。 我正在使用AppCoda的“how-to-add-search-bar-uitableview”来演示这个问题。 我只用ViewDidLoad 1行插件更改了示例代码: [_tableView setBackgroundColor:[UIColor blackColor]]; 在这里查看我的截图: tableview的底部已经变成了黑色: 但是,尽pipetableview的背景被设置为黑色,但是顶部保持灰色: 只有当我在“search栏和search显示控制器”中拖动时才会发生这种情况。 如果我从故事板中删除“search显示控制器”,这是很好的。

如何实现UITableView的刷卡删除UICollectionView

我只是想问如何实现UITableView的同样的行为在UICollectionView中删除。 我试图find一个教程,但我找不到任何。 另外,我正在使用PSTCollectionView包装来支持iOS 5。 谢谢! 编辑:滑动识别器已经很好。 我现在需要的是与取消删除模式时相同的function,例如当用户点击单元格或表格视图中的空白区域(即用户在“删除”button之外轻击时)。 UITapGestureRecognizer将无法工作,因为它只检测触摸释放的轻敲。 UITableView检测手势开始时的触摸(而不是释放时),并立即取消删除模式。

播放video到UITableView

我已经阅读了几个关于直播video/audiopost。 不幸的是,似乎没有任何“好”的解决scheme。 我想为SDWebImageView提供的video提供相同的function。 现在,我正在使用以下代码: – NSURL *url=[[NSURL alloc] initWithString:@"http://www.ebookfrenzy.com/ios_book/movie/movie.mov"]; MPMoviePlayerController *moviePlayer=[[MPMoviePlayerController alloc] initWithContentURL:url]; moviePlayer.controlStyle=MPMovieControlStyleDefault; moviePlayer.shouldAutoplay=YES; 但是当我滚动tableview ,所有的video一次又一次地下载 。 那么我怎样才能停止下载? 有没有更好的解决scheme播放video到UITableView ? 同样的Facebook,Instagram和Vine应用程序在做什么 ?

如何设置一个tableview委托

我试图使用UITableView而不使用一个笔尖,也没有使用UITableViewController 。 我已经添加了一个UITableView实例到像这样的UIViewController mytable = [[UITableView alloc] initWithFrame:CGRectMake(22, 207, 270, 233)]; [mytable setDelegate:self]; [self.view mytable]; 此外,我已经添加了下面的表视图方法到我的UIViewController (cut为重点) – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath – (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath – (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { – (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 我得到一个警告,说我的UIViewController不实现UITableView委托协议。 什么是正确的方式来告诉表视图委托方法的地方? (这是我第一次尝试使用UITableView而不从新的文件选项中selectUITableTableview控制器)

如何在prepareForSegue中获得indexpath

– (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([segue.identifier isEqualToString:@"Action"]) { NSIndexPath *indexPath = [self.tbl indexPathForSelectedRow]; SecondViewController *destViewController = segue.destinationViewController; destViewController.getString = [getArray objectAtIndex:indexPath.row]; } } 我想访问选定的行index ,但显示为每个选定的行。 请帮帮我?

如何使用自动布局animationUITableViewCell高度?

有关堆栈溢出关于UITableViewCell高度animation很多类似的问题,但没有什么适用于新的iOS8自动布局驱动的表视图。 我的问题: 定制单元格: @property (weak, nonatomic) IBOutlet iCarousel *carouselView; @property (weak, nonatomic) IBOutlet UIPageControl *pageControl; @property (weak, nonatomic) IBOutlet UIButton *seeAllButton; @property (weak, nonatomic) IBOutlet NSLayoutConstraint *carouselHeightConstraint; 注意carouselHeightConstraint 。 这是内容视图的子视图(唯一的子视图)的高度限制。 例如,高度设置为230.0f 。 在第一次加载它看起来像: 然后,在查看所有操作我想展开单元格,我的代码: – (IBAction)seeAllButtonAction:(id)sender { BOOL vertical = !self.carouselCell.carouselView.vertical; self.carouselCell.carouselView.type = vertical ? iCarouselTypeCylinder : iCarouselTypeLinear; self.carouselCell.carouselView.vertical = vertical; [UIView transitionWithView:self.carouselCell.carouselView duration:0.2 options:0 […]

iOS的UITableView:“cellForRowAtIndexPath”和“willDisplayCell:forRowAtIndexPath:”之间有什么不同

正如问题的标题所述:“ cellForRowAtIndexPath ”和“ willDisplayCell : forRowAtIndexPath :”之间有什么区别? 我认为cellconfiguration可以在cellForRowAtIndexPath或willDisplayCell: forRowAtIndexPath: “!

iOS 7.1 UitableviewCell内容与下面的内容重叠

所以我有代码,这是成功的iOS 7.0,但不是在7.1。 我有一个简单的tableview,用代码: – (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } – (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return 10; } -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return 70.0; } – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath]; for (UIView *view in cell.contentView.subviews) { [view removeFromSuperview]; } UILabel *label = [[UILabel alloc] init]; label.text […]

分组的UITableView,iOS7圆angular的解决方法

自从iOS7的推出以来,UITableView的分组样式的圆angular被Apple删除( 在这里证实 )。 不过,我确信有聪明的人在那里build立了解决方法。 请帮助我和其他许多iOS程序员, 发布你的解决方法,以获得iOS7中的UITableViewStyleGrouped中的单元格的圆angular 。 这将是非常感谢!

向下滚动时,UITableview不可见最后一个单元格

我对iOS很新。 我有一个UITableView充满了很多的自定义单元格,但当向下滚动时,底部的单元格是不可见的。我的UITableView的Y值是44,高度是480.当向下滚动时,只有最后一个单元格的一半是可见的。 我该如何解决这个问题。 提前致谢。