草庐IT

TableView1

全部标签

ios - [self.tableview reloadData];导致闪烁

问题是UI出现然后更新:产生闪烁效果。我希望UI仅在用户进入应用程序时更新一次,因此我在ViewDidLoad中重新加载了..这是代码..任何帮助如何消除这种闪烁......一些代码示例会有所帮助。-(void)viewDidLoad{[superviewDidLoad];self.myTableView.dataSource=self;self.myTableView.delegate=self;PFQuery*getCollectionInfo=[PFQueryqueryWithClassName:@"Collection"];//makequery[getCollectionIn

iphone - 在 Tableview 中创建搜索字段

我正在创建一个带有TableView的应用程序,其中包含大量数据。因此,我有必要使用搜索字段。有人知道如何在表格View中创建搜索选项吗? 最佳答案 使用UISearchBar属性,声明它使用searchBar=[[UISearchBaralloc]initWithFrame:CGRectMake(0,0,320,30)];并将其作为subview添加到UIViewController的View中。之后,在您的ViewController中使用搜索栏委托(delegate)方法:-(void)searchBarTextDidBegi

ios - 为什么 - (void)tableView :(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section not called

-(void)tableView:(UITableView*)tableViewwillDisplayHeaderView:(UIView*)viewforSection:(NSInteger)section{[viewvChangeBackgroundToCyan];}之后[self.delegateForTableController.tvDelegatedinsertSections:[NSIndexSetindexSetWithIndex:ip.section]withRowAnimation:UITableViewRowAnimationRight];如何称呼他们?

ios - 在任何滚动或表格重新加载后,在 TableView 中使用计时器重新创建计时器

我正在使用https://github.com/mineschan/MZTimerLabel/在我的TableviewcellForRowAtIndex中使用如下计时器:UILabel*lblTimer=(UILabel*)[cellviewWithTag:10];MZTimerLabel*UpgradeTimer=[[MZTimerLabelalloc]initWithLabel:lblTimerandTimerType:MZTimerLabelTypeTimer];[UpgradeTimersetCountDownTime:timestamp];[UpgradeTimerstart

ios - 如何重新加载 tableview 的特定部分

我的TableView中有56个部分,我将当前选择的部分编号存储在名为“activeTimeSlot”的整数变量中。如何使用以下方法重新加载当前选中的部分。我是这样做的[self.tblViewreloadSections:[NSIndexSetindexSetWithIndex:activeTimeSlot]withRowAnimation:UITableViewRowAnimationAutomatic];但我观察到这样做是为所有部分调用TableView的以下数据源方法,即重新加载所有部分。-(NSInteger)tableView:(UITableView*)tableView

iOS在没有删除按钮的情况下重新排序 TableView 行

我必须重新排序UITableView行而不显示默认的红色减号按钮,因为我需要显示我的自定义图像并且我不需要从UITableView中删除单元格.即使表格未处于编辑模式,是否有重新排序行的方法? 最佳答案 您需要添加此委托(delegate)方法才能不显示删除按钮-(UITableViewCellEditingStyle)tableView:(UITableView*)tableVieweditingStyleForRowAtIndexPath:(NSIndexPath*)indexPath{returnUITableViewCell

ios - iPad 上的 TableView 单元格拒绝接受清晰的颜色

我正在使用由ChrisWendel开发的名为SWTableViewCell.h的github项目。在iPhone上,清晰的颜色有效。但是,在iPad上它拒绝使tableview单元格清晰。相反,它使它变白。我一直在绞尽脑汁如何解决这个问题,但不能。我什至尝试过基于png设置背景,但它就是行不通。我可以使用哪些类型的替代方案来解决这个问题? 最佳答案 在GitHub上项目的文档中,有一个方法:-(void)tableView:(UITableView*)tableViewwillDisplayCell:(UITableViewCell

ios - 在 iOS 9 上从 TableView 打开 safari View Controller 并在 iOS 8 或 7 上在 safari 中打开

您好,如果用户使用的是iOS9或更高版本,我想从SafariViewController中的表格View单元格打开我的网站。如果用户使用的是iOS7或8,网站应该会在标准的Safari应用程序中打开。这是我目前使用的打开safari的代码。case3:{//Followussectionswitch(indexPath.row){case0:{//WebsiteNSURL*url=[NSURLURLWithString:@"http://www.scanmarksapp.com"];if(![[UIApplicationsharedApplication]openURL:url]){N

objective-c - sendAsynchronousRequest 与 tableView reloadData 延迟绘制

我正在尝试使用iOS5中添加的新sendAsynchronousRequest。我有一个模型类(File),其方法从服务器请求一些数据,然后将此数据传递给创建模型对象的Controller类(FilesController)。模型类有一个方法,代码如下:[NSURLConnectionsendAsynchronousRequest:requestqueue:[[NSOperationQueuealloc]init]completionHandler:^(NSURLResponse*response,NSData*data,NSError*error){NSArray*decodedRe

ios - 动画 [tableView reloadData]

我有一个UITableViewCell,可以在点击时展开并添加标签。Logic:IaddedalabelincellForRowAtIndexPathtotheselectedcell,andindidSelectRow...IreloadedthetableView.InheightForRow...theselectedcellexpands.Hopeyougetthepicture.在didSelectRow...中,我必须重新加载数据,而不是开始/结束更新。我想要做的是reloadData并让它动画化。我可以这样做:[UIViewtransitionWithView:table