请问一下第一次点击按钮的时候动画效果没有实现,第二次可以动画效果实现视图切换- (void)setAnimationStyle:(UIButton *)button
{
CATransition *animation = [CATransition animation];
animation.delegate = self;
animation.duration = 1.5f;
animation.timingFunction = UIViewAnimationCurveEaseInOut;
animation.type = kCATransitionFade;
animation.subtype = kCATransitionFromLeft;
[self.m_ReceiveMailListTableView.layer addAnimation:animation forKey:nil];
[self.m_SendMailListTableView.layer addAnimation:animation forKey:nil];

}
- (void)sendBtnClick:(UIButton *)button
{
[self setAnimationStyle:button];
if (self.m_ReceiveMailListTableView.superview != nil) {
[self.m_ReceiveMailListTableView removeFromSuperview];
}

if (self.m_SendMailListTableView.superview == nil) {
[self.view addSubview:self.m_SendMailListTableView];
}
}- (void)receiveBtnClick:(UIButton *)button
{
[self setAnimationStyle:button];
if (self.m_SendMailListTableView.superview != nil) {
[self.m_SendMailListTableView removeFromSuperview];
}
if (self.m_ReceiveMailListTableView.superview == nil) {
[self.view addSubview:self.m_ReceiveMailListTableView];
}
}