iphone开发者笔记
来源:互联网 发布:mac qq 截图录屏 失效 编辑:程序博客网 时间:2024/05/17 06:21
代码:
//选择按钮
NSArray*buttonNames = [NSArray arrayWithObjects:@"今天", @"本周", @"本月",nil];
UISegmentedControl* segmentedControl = [[UISegmentedControl alloc]initWithItems:buttonNames];
[segmentedControl setFrame:CGRectMake(60, 10, 200, 40)];
segmentedControl.selectedSegmentIndex=1;
//添加事件
[segmentedControl addTarget:self action:@selector(segmentAction:)forControlEvents:UIControlEventValueChanged];
[self.viewaddSubview:segmentedControl];
[segmentedControl release];
//事件
-(void)segmentAction:(UISegmentedControl *)Seg{
NSIntegerIndex = Seg.selectedSegmentIndex;
NSLog(@"Seg.selectedSegmentIndex:%d",Index);
}
2.键盘透明
textField.keyboardAppearance = UIKeyboardAppearanceAlert;
状态栏的网络活动风火轮是否旋转
[UIApplication sharedApplication].networkActivityIndicatorVisible,默认值是NO。
截取屏幕图片
//创建一个基于位图的图形上下文并指定大小为CGSizeMake(200,400)
UIGraphicsBeginImageContext(CGSizeMake(200,400));
//renderInContext 呈现接受者及其子范围到指定的上下文
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
//返回一个基于当前图形上下文的图片
UIImage *aImage = UIGraphicsGetImageFromCurrentImageContext();
//移除栈顶的基于当前位图的图形上下文
UIGraphicsEndImageContext();
//以png格式返回指定图片的数据
imageData = UIImagePNGRepresentation(aImage);
更改cell选中的背景
UIView *myview = [[UIView alloc] init];
myview.frame = CGRectMake(0, 0, 320, 47);
myview.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"0006.png"]];
cell.selectedBackgroundView = myview;
- iphone开发者笔记
- iphone开发者笔记5
- iphone开发者笔记6
- iphone开发者笔记8
- iphone开发者笔记7-Iphone开发-NSRunLoop概述和原理
- iPhone开发者完全攻略
- iphone开发者的blog
- iPhone开发者路线图
- iPhone开发者 模式
- iPhone开发者完全攻略(转载)
- iphone开发者证书下载 安装
- iphone开发者证书下载 安装
- iphone 笔记
- http://blog.csdn.net/aogufeixue-iphone开发者
- 国内iPhone开发者的两难处境
- 成为iphone游戏开发者的十个步骤
- 如何成为iPhone游戏开发者 Z
- iphone开发者证书装多台电脑的方法
- 把一个class文件用写成脚本执行文件
- 高性能MySQL(第二版)第一章 基础篇——读书笔记
- python中调用C++写的动态库
- 汉字转变成 unicode 转变成 汉字的方法
- springMVC教程
- iphone开发者笔记
- VS2008 工具栏CMFCToolBar的使用总结
- project faceted java 1.7 is not supported by target runtime apache tomcat
- ZooKeeper典型应用场景一览
- ios开发答疑录系列---Xcode 4 设置App版本号
- JVM 內存分析
- iOS Programming – 触摸事件处理
- springMVC
- The Simpsons第二季简要总结