jef*_*eff 3 iphone cocoa-touch uibutton uiswitch
我正在尝试为我的应用创建一个拉出翻盖.当您第一次点击图像/按钮时,我希望它能够显示动画以显示整个图像.当您再次点击它时,我希望它动画回原来的位置.然而,我对如何实现这一点感到困惑.我想知道是否有办法让这个按钮作为一个开关,所以我可以编程它只是[当状态开启时这样做]和[当状态关闭时这样做].非常感谢帮助!
-(IBAction)buttonClicked:(id)sender
{
UIButton *button = (UIButton *)sender;
if(button.tag==0)
{
// Do something to animate out to reveal the entire image
button.tag = 1;
}
else if(button.tag==1)
{
// Do something else to animate back to its original location
button.tag = 0;
}
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
673 次 |
最近记录: |