2011-05-10 115 views

回答

13

把你想要重新加载的代码,在视图中会出现或在视图中出现所有的视图。

所有最优秀的。

+0

日Thnx答复....但我需要像每当按下标签它装入整个页面... – Hiren 2011-05-10 08:41:54

+0

尝试使用视图并在视图内荷载规范没有出现 – Warrior 2011-05-10 09:35:03

+0

我的代码已经在viewDidAppear()并且在按下相同的标签栏按钮时不刷新。答案似乎不完整。 – Colin 2016-01-08 20:06:11

0

因此,编写一个方法重新绘制页面上的元素,并在标签页上调用它。如果您提供有关您所面临问题的更多信息,我将编辑此帖子。

0

,如果你正在使用的UITableView的使用

[tableview reloaddata]; 
3

例子:

// AppDelegate (and <UITabBarControllerDelegate>) 
    // Creation tabbar and controllers    
    UIViewController* myController1 = [[UIViewController alloc] init] autorelease]; 
    UINavigationController* nav1 = [[[UINavigationController alloc] initWithRootViewController:myController1] autorelease]; 

    UIViewController* myController2 = [[UIViewController alloc] init] autorelease]; 
    UINavigationController* nav2 = [[[UINavigationController alloc] initWithRootViewController:myController2] autorelease]; 

    NSArray *array = [NSArray arrayWithObjects: myController1, myController2, nil]; 

    UITabBarController* tab = [[[UITabBarController alloc] init] autorelease]; 
    tab.viewControllers = array; 
    tab.delegate = self; // <-- don't forget set delegate for TabBarController 


    // TabBarController Delegate methods 
    - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController; 
    { 
      // Reload selected VC's view 
     [viewController.view setNeedsDisplay]; 
    } 
0

我希望你在谈论的WebView的WebView中重新载入每一个的TabBar项导航以及时间只需在标签栏委托中实现[webview reload]。

2
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
    { 
    //other codes 

    [self.tabBarController setDelegate:self] 

    //other codes 
    } 

// UITabBarControllerDelegate method. 
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController 
{ 
    if ([viewController respondsToSelector:@selector(reloadDataTemp)]) { 
     [(YourViewController *)viewController reloadData]; 
    } 
} 
+0

这将如何在Xamarin Ios中起作用 – 2016-01-22 11:10:19

相关问题