一些常用的代码
来源:互联网 发布:网络系统集成中的软件 编辑:程序博客网 时间:2024/06/06 03:24
1. 为image view、label等组件添加动作
UIImageView *imgView = [[UIImageView alloc] init];
UITapGestureRecognizer *gesture = [[UITapGestureRecognizer alloc] initWithTarget: self action: @selector(imageViewClicked:)];
gesture.numberOfTouchesRequired = 1;
gesture.numberOfTapsRequired = 1;
[imgView addGestureRecognizer: gesture];
2. 获取一个实例的类名
Class cla = [imgView class];
NSString *des = [cla description];
3. UIToolBar支持blur(毛玻璃)效果,如果不想用开源代码,其实可以直接把toolbar当作view来用
UIToolbar *toolbar = [[UIToolbar alloc] initWithFrame: [[UIScreenmainScreen]bounds]];
toolbar.barStyle = UIBarStyleBlackTranslucent;
toolbar.translucent = YES;
4. 获取某个cell当前的origin.y
NSIndexPath *indexPath = [NSIndexPath indexPathForRow: btn.tag inSection: 0];
CGRect cellRect = [self.tableView rectForRowAtIndexPath: indexPath];
float y = cellRect.origin.y - self.tableView.contentOffset.y;
- 一些常用的代码
- 一些常用的代码
- 一些常用的代码
- 常用的一些代码
- 常用的一些代码
- 一些常用的代码
- 一些常用的辅助代码
- 常用的一些教本代码
- 一些常用的CSS代码
- 一些常用的Javascript代码
- 一些常用的辅助代码
- Jquery 的一些常用代码
- jquery常用的一些代码
- CListCtrl 常用的一些代码
- 一些常用的JAVAscript代码
- 常用的一些javascript代码
- 常用的一些代码块
- js常用的一些代码
- LeetCode(141)Linked List Cycle
- 用 Python 脚本实现对 Linux 服务器的监控
- epoll 实例
- java中常见的数据算法
- 代理模式----C++实现
- 一些常用的代码
- linux 多线程的线程控制和线程通信
- Future异步事件驱动
- 改变ubuntu下系统字体
- 马云杀入手游业挑战腾讯 游戏开发商分成比提至70%厉害
- ACPI Tables
- 人工神经网络ANN的一些概念的集合
- ViewPager结合Fragment实现页面左右滑动
- addd