我想在不使用 removeFromSuperView 和 addSubview 的情况下动态更改 UIView 的内容。代码是我想要做的图像。
int screenWidth = [[UIScreen mainScreen] bounds].size.width;
int screenHeight = [[UIScreen mainScreen]bounds].size.height;
UIView *currentView = [[UIView alloc]initWithFrame:CGRectMake(0,0,screenWidth,screenHeight)];
UIView *nextView = [[UIView alloc]initWithFrame:CGRectMake(0,0,screenWidth,screenHeight)];
[self.view addSubview:currentView];
currentView = nextView;
//when this code run,appearing currentView swap nextView.
[self.view reload];