Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道如何在按下按钮时显示图像。但是,一旦第二次按下按钮,你如何再次“隐藏”图像?这是我到目前为止所拥有的一切......
-(IBAction)Light { LightLCD.hidden = NO; }
尝试
-(IBAction)Light { LightLCD.hidden = !LightLCD.hidden; }
像这样:
- (IBAction)Light { LightLCD.hidden = !LightLCD.hidden; }
这样您就可以切换 imageView 的可见性。