左右移动线条

来源:互联网 发布:教学基本状态数据 编辑:程序博客网 时间:2024/04/28 02:37

-(void)segmentedAction:(id)sender{

    

    [UIImageViewbeginAnimations:@"anim"context:NULL];

    [UIImageViewsetAnimationCurve:UIViewAnimationCurveEaseInOut];

    [UIImageViewsetAnimationBeginsFromCurrentState:YES];

    [UIImageViewsetAnimationDuration:0.5];

   CGRect listFrame = CGRectMake(0.0f, 0.0f, 0.0f, 0.0f);

    

    UISegmentedControl *control = (UISegmentedControl *)sender;

    switch (control.selectedSegmentIndex) {

       case 0:

           status = 2;

            listFrame =CGRectMake(0.0f,44.0f, 80, 0.5f);

           break;

       case 1:

           status = 1;

            listFrame =CGRectMake(80.0f,44.0f, 80, 0.5f);

           break;

       case 2:

           status = 3;

            listFrame =CGRectMake(160.0f,44.0f, 80, 0.5f);

           break;

       case 3:

           status = 4;

            listFrame =CGRectMake(240.0f,44.0f, 80, 0.5f);

           break;

            

       default:

           break;

    }

   lineView.frame = listFrame;

    [UIImageViewcommitAnimations];

    [selfrequestListWithStatus];

}


0 0
原创粉丝点击