我在自定義UISwitch DCRoundSwitch的選擇器方法內完成了以下動畫代碼。與DCRoundSwitch一起使用時UIView動畫不起作用
if ([[[App.remindersArray objectAtIndex:0] objectAtIndex:3]isEqualToString:@"YES"]){
[firstReminderOnOffButton setSelected:YES];
[swtchDailyReminder setOn:YES];
imgviewDailyReminder.image=[UIImage imageNamed:@"nDailyReminder_On_1.png"];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.35];
[UIView setAnimationDidStopSelector:@selector(animateFadingIn)];
[UIView setAnimationDelegate:self];
imgviewDailyReminderAnimation.alpha = 1.0;
[UIView commitAnimations];
}
else
{
[firstReminderOnOffButton setSelected:NO];
[swtchDailyReminder setOn:NO];
imgviewDailyReminder.image=[UIImage imageNamed:@"xDailyReminder_OFF.png"];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.35];
[UIView setAnimationDidStopSelector:@selector(animateFadingIn)];
[UIView setAnimationDelegate:self];
imgviewDailyReminderAnimation.alpha = 0.0;
[UIView commitAnimations];
}
問題是動畫工作正常上面的代碼,當從正常UISwitch叫,而是從DCRoundSwitch調用時不能正常工作。
還試圖通過使用UIView塊動畫....但仍然面臨問題的解決。
請指導我。