如何刷新Scrollview内部的viewcontrollers?

问题描述 投票:0回答:1

我在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];
ios objective-c uiviewcontroller uiscrollview
1个回答
0
投票

循环通过controllerArray并调用viewDidLoad

© www.soinside.com 2019 - 2024. All rights reserved.