Hoang Pham
Hoang Pham

Reputation: 6949

TTLauncherView in iPad landscape mode has a blank white area on the right

I have not spent enough time yet to look at the code behind TTLauncherView, but it seems to have a blank white area on the right in landscape mode. I am thinking of rewriting the launcher, but anyone has a more elegant solution? I want to remove the blank white area and instead reorganize the items to that blank area.

Upvotes: 0

Views: 1476

Answers (2)

Yer00n
Yer00n

Reputation: 123

This can be done even easier. I like this solution without the willRotate method:

-(void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
  [UIView beginAnimations:nil context:NULL];
  [_launcherView setFrame:self.view.bounds];
  [UIView commitAnimations];
}

It does the job for me!

Upvotes: 0

Oliver
Oliver

Reputation: 26

I think you can do this a lot easier than that... I'm pretty new to this toolkit, but this seems to work in my application:

-(void) willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
[self.view setBackgroundColor:[UIColor clearColor]];

}

-(void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
    [_launcherView setFrame:self.view.bounds];
}

EDIT: Sorry for the edits, I just keep finding better ways to do this. We can override an animation method that automatically animates the rotation of our TTLauncherItems. I've changed the alpha of the view to hide the abruptness of the rotation of the icons:

-(void) willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
    [_launcherView setFrame:self.view.bounds];
    //[self.view setAlpha:0.4];
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:.1];
    [self.view setAlpha:1];
    [UIView commitAnimations];
}
-(void) willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
    [self.view setBackgroundColor:[UIColor clearColor]];
    [self.view setAlpha:1];
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:.1];
    [self.view setAlpha:0.7];
    [UIView commitAnimations];

}

Upvotes: 1

Related Questions