Tag: uitableview

在tableView中实现“更多”button,而无需重新加载整个tableView

我正在开发一个iOS应用程序,其中我有一个UITableView包含来自Web服务的人员列表,我有一个更底部的button。 当用户点击更多时,它会调用一个为列表提供一些新用户的服务。 现在我想添加这个列表与以前的tableView列表,而无需重新加载整个tableView。 我如何做到这一点。 任何帮助将是非常可观的。 我可以提供更多button的代码,我打电话给服务来获取服务的数据。

如何在自动布局中添加视差效果

我正在使用大小类的自动布局。 我想在UITableViewCell上添加视差效果,所以我参考。 以下链接 https://github.com/fernandospr/FSParallaxTableView https://github.com/jberlana/JBParallaxCell 但他们没有使用自动布局,任何想法如何应用视差效果的imageView大小类上和自动布局时使用。

与UITableView单元格中的UIScrollView问题

我一直在试图添加一个滚动视图到我的表视图的单元格,但一直运行到图像丢失的问题。 滚动视图中的页面似乎正在加载(基于debugging视图层次结构),但没有显示任何图像。 这是我的代码: class AppImagesTableViewCell: UITableViewCell, UIScrollViewDelegate { @IBOutlet weak var scrollView: UIScrollView! @IBOutlet weak var pageControl: UIPageControl! @IBOutlet weak var label: UILabel! var pageViews: [UIImageView?] = [] var sixPlusImages: [UIImage?] = [] override func awakeFromNib() { super.awakeFromNib() sixPlusImages = [ UIImage(named: "Glance 5.5.png"), UIImage(named: "Currencies 5.5.png"), UIImage(named: "Swipe 5.5.png"), UIImage(named: "Format 5.5.png"), UIImage(named: "Search […]

内容拥抱优先级dynamic单元格大小

最近我有一个复杂的自动布局情况已经解决(感谢@Catalina吨)。 目前我遇到了内容拥抱优先问题。 我有4个dynamic标签可能包含巨大的文本,所以单元格应该适合内容。 有了目前的限制和优先事项,如果我把巨大的文本给所有的dynamic标签,它完美的作品(虽然其中一个将不会完全显示,而是会用点来裁剪)。 如果我将第三个标签的文本设置为一个巨大的自动布局变得疯狂…我得到这样的东西: 而我希望所有的标签都会被安排。 演示项目 。 如何解决这个问题? 先谢谢你!

使用pickerView填充多个部分tableView

我有一个tableview的数据从一个pickerView(3列)中select。这里是代码: – (void)viewDidLoad { [super viewDidLoad]; //PickerView content and sort them for displaying Number=@[@"Trans",@"2005",@"2006",@"2007",@"2008",@"2009",@"2010",@"2011",@"2012",@"2013",@"2014",@"2015",@"2016"]; Season=@[@"Spring",@"Summer",@"Fall"]; Course=@[@"CHEM1100 General Chem I",@"CHEM2100 General Chem II",@"CHEM3511 Org Chem",@"CHEM3521 Org Chem II"]; Course =[Course sortedArrayUsingSelector:@selector(compare:)]; Number =[Number sortedArrayUsingSelector:@selector(compare:)]; Season =[Season sortedArrayUsingSelector:@selector(compare:)]; _tableView.delegate = self; _tableView.dataSource = self; } 为了填充tableView,我使用了一个button,当button被按下时,pickerView的select将把数据发送到tableView – (IBAction)addCourse:(UIButton *)sender { NSInteger numRow=[picker selectedRowInComponent:kNumComponent];//0=1st,1=2nd,etc NSInteger SeaRow=[picker selectedRowInComponent:kSeaComponent];//0=fall,1=spring,2=summer NSInteger […]

添加顶部/底部视图到UITableViewController?

在我的故事板,我有UITableViewController具有自定义类。 如何在表视图的顶部和底部添加UIView对象? 我必须创buildUITableView和UIView里面的两个所需的视图,然后手动初始化我的控制器,设置tableView还是有更好的方法?

每行UITableView的button

我有一个自定义单元格在一个自定义类(.h和.m文件)定义的UITableView中。 我能够显示单元格,并更改列表中的每个单元格的文本,但我的自定义单元格中也有button(实际上是两个)。 当我点击button时,我需要知道哪一行的button已被点击。 有没有什么办法可以在自定义的ui单元类中获取? 我希望我所要求的是明确的。 如果没有,请随时发表评论,我会尽力解释。

IOS 8 Objective-Csearch栏和表格视图使用Google自动完成

我是iOS开发的新手,现在我一直被这个问题困住了两个星期。 我正在尝试使用Googlesearch结果中的自动完成function创buildsearch栏。 我已经能够做到的最接近的是通过Hybrid Forge学习本教程 。 (我发现的其他教程不使用ARC,已经非常过时了。) 我能够看到URL连接通过NSLog正常工作,但问题在于我重新分配我的build议数组。 如果我注释掉这部分: _suggestionArray = [NSArray arrayWithArray:json[@"responseData"][@"results"]]; [_tableView reloadData]; 它给出了这个错误: [__NSCFDictionary isEqualToString:]: unrecognized selector sent to instance 0x7f968be3a060 2015-05-21 17:43:11.277 AutoComplete[865:65704] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary isEqualToString:]: unrecognized selector sent to instance 0x7f968be3a060' *** First throw call stack: ( 0 CoreFoundation 0x00000001077daa75 __exceptionPreprocess + 165 […]

在ios中覆盖UItable View Cell中的内容

在我的表格视图单元格中,我需要显示我的数组元素的内容在一个单元格中,如果我插入任何新的内容,以前的内容不会被覆盖。以前的内容和我的新内容应按顺序显示。这里是我的代码 – (void)viewDidLoad { [super viewDidLoad]; NSArray *arr=[NSArray arrayWithObjects:cnfqty,cnftitle,cnfrate, nil]; //cnfqty,cnftitle,cnfrate are NSString finarray=[[NSMutableArray alloc]init]; [finarray addObjectsFromArray:arr]; NSLog(@"%@",finarray); } – (void)viewDidUnload { [super viewDidUnload]; } – (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait); } #pragma mark – Table view data source – (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { // Return the number of sections. return 1; } – (NSInteger)tableView:(UITableView […]

自定义部分头uilabel背景和文本

我目前正在创build自己的自定义部分标题,但我从来没有不通过代码编辑任何文本..我用我的新方法来填充我的自定义标题是做一些奇怪的事情,如图所示 下面 我想改变文字为白色,稍大胆,也使白色背景透明.. 这是我用来做这个的代码 – (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 30)]; [headerView setBackgroundColor:[UIColor grayColor]]; // Add the label UILabel *headerLabel = [[UILabel alloc] initWithFrame:CGRectMake(0.0, 0.5, 20, 20)]; // do whatever headerLabel configuration you want here headerLabel.text = [self tableView:tableView titleForHeaderInSection:section]; [headerView addSubview:headerLabel]; // Return the headerView […]