cbess/AutoScrollLabel

Scroll label in tableview stops when changing tabs.

BigBangInc opened this issue · 1 comments

I have a scrolling label in a table cell that works on first load. When changing tabs or views and switching back the label no longer scrolls in the table.

I have tried the following:

-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:true];
[self playlistTableSetup];
}

// Playlist Table Setup

  • (void)playlistTableSetup{
    playlistTableVC = [self.storyboard instantiateViewControllerWithIdentifier:@"PlaylistTable"];
    playlistTableVC.view.frame = CGRectMake(0, 70, 320, self.view.bounds.size.height-170);
    [self.view addSubview:playlistTableVC.view];
    [self addChildViewController:playlistTableVC];
    }

-(void)viewDidDisappear:(BOOL)animated{
[playlistTableVC removeFromParentViewController];
playlistTableVC = nil;
}

This seems to adds a table over the existing and I have a opaque background so you can see multiple tables overlaying one another.

I have also tried reloading the data:
-(void)viewDidAppear:(BOOL)animated{
[playlistTable reloadData];
}

Fixed..

-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:true];
[self playlistTableSetup];
}

// Playlist Table Setup

-(void)playlistTableSetup{ playlistTableVC = [self.storyboard instantiateViewControllerWithIdentifier:@"PlaylistTable"]; playlistTableVC.view.frame = CGRectMake(0, 70, 320, self.view.bounds.size.height-170); [self.view addSubview:playlistTableVC.view]; [self addChildViewController:playlistTableVC]; }

-(void)viewDidDisappear:(BOOL)animated{
[playlistTableVC.view removeFromSuperView];
playlistTableVC = nil;
}