Tag: 重新加载

如何在navigationController中重新加载rootViewController当按“返回”?

navigationController中有2个viewController:navigationController-> root-> A 在viewController A中,如果用户进行一些设置,然后按左边的条形button项(Back),我想让根视图更新它的布局(有些视图的大小会改变)。 现在,我通过在两个viewControllers之间添加一个navigationController(模态地)来实现它:navigationController-> root-> navigationController-> A。 有没有办法用一个navigationController更新根viewController?(截图1) 谢谢。 —–编辑—– 示例代码: override func viewWillAppear(_ animated: Bool) { creatButtons() } func createButtons(){ let button1 = UIButton() …….. let button2 = UIButton() …….. ……. } 如果我在viewWillAppear()下面创build了16个button,那么从A返回时所有的button是否都会被复制? 他们的大小都需要更新。

如何重新加载UIVIew的UIViewController数据

实际上我有一个UIVIewController它有一个自定义类的UIViewcontroller在UIViewcontroller我有一个标签,我需要打印UIView定义的标签的值。 但是UIViewController viewdidload是先编译的,然后编译器移动到UIView ,然后我怎么打印或重新载入UIVIewController 。 UILabel Text我在UIViewController的View DidLoad中定义了从UIView类中取得的值 那么如何重新加载UIViewController 。 我正在做的是: UIVIewController (thirdTab)类 -(void)viewDidLoad{ [self reloadInputViews1]; } -(void)reloadInputViews1{ appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; // labelPrint.text=appDelegate.dayPrint; [self.labelPrint setText:labelPrint.text]; } UIView类 – (void)drawRect:(CGRect)rect { AppDelegate* appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; appDelegate.dayPrint=theDate; NSLog(@"appde%@",appDelegate.dayPrint); [appDelegate.thirdTab reloadInputViews1]; } 但是这不起作用…我不能够在label.how中打印值..要从UIViews中获取值

刷新UIwebview没有任何晃动?

目前iam使用下面的代码刷新webview [webview reload]; 但在这种情况下,当我打开viewcontroller我可以看到突然的运动(摇摆或跳跃)的UIWebview在viewcontroller 。是否有任何方式来刷新在后台我的意思是没有任何更改的web视图运动?

表视图重新加载部分崩溃

我有一个表格视图,每节有4个部分和1-2个表格视图单元格。 第一个单元有一个uiswitch作为附件视图,并控制应用程序的颜色主题,在白天模式和夜间模式之间切换。 一旦开关被击中,一个函数被调用,改变导航栏的颜色和背景颜色。 在那个函数中,我也放了一行 [self.tableview reloadData]; 用新颜色更新表格本身。 它工作正常,但没有animation,所以我用这个来代替 [self.tableView reloadSections:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, 3)] withRowAnimation:UITableViewRowAnimationFade]; 当使用该行时,开关卡住,应用程序冻结。 它并没有崩溃,即没有崩溃日志,它只是冻结,并且uiswitch在animation中间停止。 我注意到,我可以重新加载没有包含附件视图的单元格的部分,并且与淡入淡出的animation完美配合。 即这工作 [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:2] withRowAnimation:UITableViewRowAnimationFade]; 因为第三部分没有附件视图的单元格。 但是,如果我尝试重新加载应用程序,任何包含附件视图的单元格(即,区段0和2)都会冻结。 任何想法为什么发生这种情况? 以下是我的cellForRowAtIndexPath – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *cellIdentifier; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; if (cell == nil) cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellIdentifier]; if (indexPath.section == 0) { […]

UITableView的reloadRowsAtIndexPaths:(NSArray *)indexPaths无法重新加载,除非你调用它两次?

我有一个UITableViewControllerpipe理iPad应用程序中的UITableView对象。 表格视图与其他对象的相当复杂的星座捆绑在一起。 我有一个问题,当我问它重新加载一行如下: //indexPath is an NSIndexPath with indexes 0 and 0. At the moment, this is the only cell in the table view. NSArray *array = [NSArray arrayWithObject:indexPath]; [self.tableView reloadRowsAtIndexPaths:array withRowAnimation:UITableViewRowAnimationNone]; 问题是该行不重新加载。 从来没有callbackcellForRowAtIndexPath。 疯狂的事情是,如果我调用reloadRowsAtIndexPaths两次,第二次调用确实会触发重载: //indexPath is an NSIndexPath with indexes 0 and 0. At the moment, this is the only cell in the table […]

更改UITableView的部分页眉/页脚标题,而无需重新加载整个表格视图

有没有办法重新加载表视图的部分页眉/页脚,而无需调用[tableView reloadData]; ? 实际上,我想在表格视图的部分页脚中显示单元格的数量。 表视图是可编辑的,我使用删除或插入行 – insertRowsAtIndexPaths:withRowAnimation: – deleteRowsAtIndexPaths:withRowAnimation: 看来这些方法不会更新节页脚。 奇怪的是,当我调用这些方法的表视图的数据源方法 – (NSString *)tableView:(UITableView *)table titleForFooterInSection:(NSInteger)section 被称为(两次!),但它不会更新与新值的表视图! 任何人有任何想法如何解决这个问题?