我想出了如何动态添加 UIView 的大部分内容,但现在我被困在尝试创建 alpha 动画时,单击 uibutton 并显示 uiview。不确定我在这里缺少什么:
- (void)buttonPressedAction:(id)sender
{
CGRect frame;
frame.origin.x = 0;
frame.origin.y = 0;
frame.size = self.scrIcon.frame.size;
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
UIView* view = [[UIView alloc] initWithFrame:frame];
view.alpha = 1.0;
[UIView commitAnimations];
view.backgroundColor = [UIColor redColor];
[scrIcon addSubview:view];
/*
UIStoryboard* sb = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:[NSBundle mainBundle]];
CategoryViewController* theView = [sb instantiateViewControllerWithIdentifier:@"categoryIdentifier"];
theView.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:theView animated:YES];*/
}
scrIcon 是一个 UIScrollView
谢谢