如何刷新Scrollview内部的viewcontrollers?
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何刷新Scrollview内部的viewcontrollers?相关的知识,希望对你有一定的参考价值。
我在scrollview内部有一组视图控制器,它与scrollview菜单相连。当我从菜单滚动中单击菜单时,它会显示受尊重的viewcontrollers。但最初加载了所有视图控制器。当我点击尊敬的菜单时,我需要重新加载视图控制器。我的代码看起来像
btnArray = @[@"Dashboard", @"Daily Log", @"Labour Timesheet", @"Work Safety", @"Soil", @"Equipment", @"Site Photos", @"Quick Links", @"Printable Forms"];
[self addButtonsInScrollMenu:btnArray];
DashBoardViewController *dashboardVC = [storyBoard instantiateViewControllerWithIdentifier:@"Dashboard"];
DailyReportListViewController *dailyLogVC = [storyBoard instantiateViewControllerWithIdentifier:@"DailyReportListVC"];
TimeSheetListViewController *labourTimesheetVC = [storyBoard instantiateViewControllerWithIdentifier:@"TimeSheetListVC"];
SafetyReportListViewController *workSafetyVC = [storyBoard instantiateViewControllerWithIdentifier:@"SafetyReportListVC"];
DashBoardViewController *soilVC = [storyBoard instantiateViewControllerWithIdentifier:@"Dashboard"];
DashBoardViewController *equipmentVC = [storyBoard instantiateViewControllerWithIdentifier:@"Dashboard"];
DashBoardViewController *sitePhotosVC = [storyBoard instantiateViewControllerWithIdentifier:@"Dashboard"];
DashBoardViewController *quickLinksVC = [storyBoard instantiateViewControllerWithIdentifier:@"Dashboard"];
DashBoardViewController *printableFormsVC = [storyBoard instantiateViewControllerWithIdentifier:@"Dashboard"];
controllerArray = @[dashboardVC, dailyLogVC, labourTimesheetVC, workSafetyVC, soilVC, equipmentVC, sitePhotosVC, quickLinksVC, printableFormsVC];
[self addChildViewControllersOntoContainer:controllerArray];
答案
循环通过controllerArray并调用viewDidLoad
以上是关于如何刷新Scrollview内部的viewcontrollers?的主要内容,如果未能解决你的问题,请参考以下文章
SCrollView嵌套GridView,ScrollView如何实现上啦加载下拉刷新???
如何在 Kotlin 中刷新 ScrollView/LinearLayout
android解决ScrollView嵌套ListView不能下拉刷新