我正在 viewDidLoad 方法上创建一个视图,它可以找到,但是当我在按钮单击上添加具有不同 x 和 y 点的相同视图时,它不会刷新或工作它显示首先加载的原始视图,因此如何显示或刷新相同的视图与新点。
在我看来确实加载了
int height3=(int)roundf(appDelegate.Same_Vaccination_MildEI_Unvaccinated);
thirdView=[[UIView alloc] initWithFrame:CGRectMake(190,360,100,-height3)];
thirdView.backgroundColor=[UIColor colorWithRed:(102/255.f) green:(107/255.f)
blue:(40/255.f) alpha:1];
[self.view addSubview:thirdView];
再次点击按钮
-(IBAction)showUpdates{
int height3=(int)roundf(appDelegate.Same_Vaccination_MildEI_Unvaccinated);
thirdView=[[UIView alloc] initWithFrame:CGRectMake(200,400,100,-height3)];
thirdView.backgroundColor=[UIColor colorWithRed:(102/255.f)
green:(107/255.f) blue:(40/255.f) alpha:1];
[self.view addSubview:thirdView];
}