左右移动线条
2015-10-10 13:54
267 查看
-(void)segmentedAction:(id)sender{
[UIImageView
beginAnimations:@"anim"
context:NULL];
[UIImageView
setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIImageView
setAnimationBeginsFromCurrentState:YES];
[UIImageView
setAnimationDuration: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;
[UIImageView
commitAnimations];
[self
requestListWithStatus];
}
[UIImageView
beginAnimations:@"anim"
context:NULL];
[UIImageView
setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIImageView
setAnimationBeginsFromCurrentState:YES];
[UIImageView
setAnimationDuration: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;
[UIImageView
commitAnimations];
[self
requestListWithStatus];
}
相关文章推荐
- SQL注入——如何防御(一)
- html的input输入框提示信息 点击隐藏
- How to change hostname on SLE
- Zend Studio 12 安装 Aptana报错解决办法
- LeetCode:Single Number
- ViewPager的PagerAdapter不可以更新数据
- linux 下利用ls grep 和正则表达式实现目录和文件的分开显示
- facadez模式
- 曹政解密中国互联网
- 如何使用git工作(更新中)
- 技术简历的七要七不要
- 大整数加减 加减运算
- srm 549
- 四倍经验:2010年省队选拔赛山东——大陆争霸
- 三个实例演示 Java Thread Dump 日志分析
- MYSQL 源代码编绎脚本
- Hadoop-调优剖析
- Android完美解决输入框EditText隐藏密码打勾显示密码问题
- HDOJ 4815 Little Tiger vs. Deep Monkey(概率DP)
- 2015 10月10日 工作计划与执行