【问题标题】:How to refresh the viewcontrollers in inside Scrollview?如何刷新 Scrollview 内部的视图控制器?
【发布时间】:2018-06-03 20:03:49
【问题描述】:

我在滚动视图内部有一组视图控制器,它与滚动视图菜单连接。当我从菜单滚动中单击菜单时,它会显示受尊敬的视图控制器。但最初加载的所有视图控制器。当我单击受尊重的菜单时,我需要重新加载视图控制器。我的代码看起来像

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】:

遍历controllerArray并调用viewDidLoad

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-03-31
    • 1970-01-01
    • 1970-01-01
    • 2016-07-28
    • 2018-04-02
    • 2018-06-10
    • 2023-03-14
    相关资源
    最近更新 更多