- 浏览: 697845 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
utyujin:
作者你好,首先自我注释一下我是一名UI设计师,最近在写关于屏幕 ...
android中的dp,px深度解析 -
eagledame:
<data android:scheme="p ...
Android利用系统广播---监听应用程序安装和卸载[转] -
圣经未来:
虽然帖子距今已有三年,但是我还是来评论一下。对于这段话: 这句 ...
android中的dp,px深度解析 -
passerby_whu:
如果Activity中已经有了很多id了。怎么样保证你指定的i ...
Android Layout 之 RelativeLayout,代码实现相对布局 -
passerby_whu:
u013023750 写道楼主你好 ...
android中的dp,px深度解析
iphone代码
//创建一个UIView对象
UIView *myview = [[UIView alloc] init];
//设置UIView对象的外观大小
myview.frame = CGRectMake(0, 0, 320, 47);
//设置UIView对象的背景色。 [UIColor colorWithPatternImage:[UIImage imageNamed:@"0006.png"]] 从图片中创建颜色
myview.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"0006.png"]];
//设置cell被选中时的颜色
cell.selectedBackgroundView = myview;
在数字键盘上添加button:
iphone代码
//定义一个消息中心
//addObserver:注册一个观察员 name:消息名称
游戏编程 2009FLY文摘,正正博客 WWW.2009FLY.COM
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(keyboardWillShow:)
name:UIKeyboardWillShowNotification object:nil];
//定义的动作
- (void)keyboardWillShow:(NSNotification *)note {
// 创建一个自定义的UIButton对象
UIButton *doneButton = [UIButton buttonWithType:UIButtonTypeCustom];
//设置UIButton大小的外观大小
doneButton.frame = CGRectMake(0, 163, 106, 53);
//设置该UIButton对象在正常状态下显示的图片
[doneButton setImage:[UIImage imageNamed:@"5.png"] forState:UIControlStateNormal];
//注册事件
[doneButton addTarget:self action:@selector(addRadixPoint) forControlEvents:UIControlEventTouchUpInside]; 移动开发,Android、iPhone 2009FLY文摘,正正博客 WWW.2009FLY.COM
// locate keyboard view取得UIWindow对象
UIWindow* tempWindow = [[[UIApplication sharedApplication] windows] objectAtIndex:1];UIView* keyboard;
//遍历window上的所有subview
for(int i=0; i<[tempWindow.subviews count]; i++)
{
keyboard = [tempWindow.subviews objectAtIndex:i];
// keyboard view found; add the custom button to it //如果该subview是键盘,就在该键盘上添加创建的button 对象
if([[keyboard description] hasPrefix:@"<UIKeyboard"] == YES)
[keyboard addSubview:doneButton];
}
}
正则表达式使用:
被用于正则表达式的字串必须是可变长的,不然会出问题 内容来自www.2009fly.com 2009FLY文摘,正正博客 WWW.2009FLY.COM
将一个空间放在视图之上.above:在什么之上的意思
iphone代码
[scrollView insertSubview:searchButton aboveSubview:scrollView];
从本地加载图片
iphone代码
//取得当前应用程序的束--[NSBundle mainBundle]
//取得资源的路径
NSString *boundle = [[NSBundle mainBundle] resourcePath];
[web1 loadHTMLString:[NSString stringWithFormat:@"<img src='0001.png'/>"]
baseURL:[NSURL fileURLWithPath:boundle]];
从网页加载图片并让图片在规定长宽中缩小
iphone代码
[cell.img loadHTMLString:
内容来自www.2009fly.com 2009FLY文摘,正正博客 WWW.2009FLY.COM
[NSString stringWithFormat:@"<html><body><img src='% @'height='90px'width='90px'></body></html>",goodsInfo.GoodsImg]
baseURL:nil
];
将网页加载到webview上通过javascript获取里面的数据,
如果只是发送了一个连接请求获取到源码以后可以用正则表达式进行获取数据
C代码
1. NSString *javaScript1 = @"document.getElementsByName('.u').item(0).value";
2. NSString *javaScript2 = @"document.getElementsByName('.challenge').item(0).value";
3. NSString *strResult1 = [NSString stringWithString:[theWebView stringByEvaluatingJavaScriptFromString:javaScript1]];
4. NSString *strResult2 = [NSString stringWithString:[theWebView stringByEvaluatingJavaScriptFromString:javaScript2]];
内容来自www.2009fly.com 2009FLY文摘,正正博客 WWW.2009FLY.COM
用NSString怎么把UTF8转换成unicode
iphone代码
utf8Str //
NSString *unicodeStr = [NSString stringWithCString:[utf8Str UTF8String] encoding:NSUnicodeStringEncoding];
View自己调用自己的方法:
iphone代码
//黄色段为方法名,和延迟几秒执行.loginToNext:方法名称 。afterDelay:2--延长2秒调用
[self performSelector:@selector(loginToNext) withObject:nil afterDelay:2];
显示图像:
Java代码
CGRect myImageRect = CGRectMake(0.0f, 0.0f, 320.0f, 109.0f);
UIImageView *myImage = [[UIImageView alloc] initWithFrame:myImageRect];
[myImage setImage:[UIImage imageNamed:@"myImage.png"]];
//opaque是否透明
myImage.opaque = YES;
[self.view addSubview:myImage];
内容来自www.2009fly.com 2009FLY文摘,正正博客 WWW.2009FLY.COM
[myImage release];
WebView:
iphone代码
CGRect webFrame = CGRectMake(0.0, 0.0, 320.0, 460.0);
UIWebView *webView = [[UIWebView alloc] initWithFrame:webFrame];
[webView setBackgroundColor:[UIColor whiteColor]];
NSString *urlAddress = @"http://www.google.com";
NSURL *url = [NSURL URLWithString:urlAddress];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[webView loadRequest:requestObj];
[self addSubview:webView];
[webView release];
显示网络活动状态指示符
这是在iPhone左上部的状态栏显示的转动的图标指示有背景发生网络的活动。
iphone代码
内容来自www.2009fly.com 2009FLY文摘,正正博客 WWW.2009FLY.COM
UIApplication* app = [UIApplication sharedApplication];
app.networkActivityIndicatorVisible = YES;
动画:一个接一个地显示一系列的图象
iphone代码
NSArray *myImages = [NSArray
arrayWithObjects:
[UIImage imageNamed:@"myImage1.png"],
[UIImage imageNamed:@"myImage2.png"],
[UIImage imageNamed:@"myImage3.png"],
[UIImage imageNamed:@"myImage4.gif"],
nil];
//创建一个UIImageView对象
2009FLY文摘,正正博客 WWW.2009FLY.COM
UIImageView *myAnimatedView = [UIImageView alloc];
//初始化UIImageView对象的大小
[myAnimatedView initWithFrame:[self bounds]];
//animationImages属性返回一个存放动画图片的数组
myAnimatedView.animationImages = myImages;
//浏览整个图片一次所用的时间
myAnimatedView.animationDuration = 0.25;
// 0 = loops forever 动画重复次数
myAnimatedView.animationRepeatCount = 0;
//开始动画
[myAnimatedView startAnimating];
//把该UIImageView对象添加到view视图中
[self addSubview:myAnimatedView];
//释放
[myAnimatedView release];
动画:显示了something在屏幕上移动。
注:这种类型的动画是“开始后不处理” -你不能获取任何有关物体在动画中的信息(如当前的位置) 。
内容来自www.2009fly.com 2009FLY文摘,正正博客 WWW.2009FLY.COM
如果您需要此信息,您会手动使用定时器去调整动画的X和Y坐标
这个需要导入QuartzCore.framework
Java代码
CABasicAnimation *theAnimation;
theAnimation=
[CABasicAnimation animationWithKeyPath:@"transform.translation.x"];
//Creates and returns an CAPropertyAnimation instance for the specified key path.
//parameter:the key path of the property to be animated
theAnimation.duration=1;
theAnimation.repeatCount=2;
theAnimation.autoreverses=YES;
theAnimation.fromValue=[NSNumber numberWithFloat:0];
theAnimation.toValue=[NSNumber numberWithFloat:-60];
[view.layer addAnimation:theAnimation forKey:@"animateLayer"];
游戏编程 2009FLY文摘,正正博客 WWW.2009FLY.COM
Draggable items//拖动项目
Here's how to create a simple draggable image.//这是如何生成一个简单的拖动图象
iphone代码
1. Create a new class that inherits from UIImageView
@interface myDraggableImage : UIImageView
{
}
2. In the implementation for this new class, add the 2 methods:
- (void) touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event
{
// Retrieve the touch point 检索接触点 游戏编程 2009FLY文摘,正正博客 WWW.2009FLY.COM
CGPoint pt = [[touches anyObject] locationInView:self];
startLocation = pt;
[[self superview] bringSubviewToFront:self];
}
- (void) touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event
{
// Move relative to the original touch point 相对以前的触摸点进行移动
CGPoint pt = [[touches anyObject] locationInView:self];
CGRect frame = [self frame];
frame.origin.x += pt.x - startLocation.x;
frame.origin.y += pt.y - startLocation.y;
[self setFrame:frame];
}
3. Now instantiate the new class as you would any other new image and add it to your view copyright 2009fly 2009FLY文摘,正正博客 WWW.2009FLY.COM
//实例这个新的类,放到你需要新的图片放到你的视图上
dragger = [[myDraggableImage alloc] initWithFrame:myDragRect];
[dragger setImage:[UIImage imageNamed:@"myImage.png"]];
[dragger setUserInteractionEnabled:YES];
线程:
Java代码
1. Create the new thread:
[NSThread detachNewThreadSelector:@selector(myMethod)toTarget:self withObject:nil];
2. Create the method that is called by the new thread:
- (void)myMethod
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
*** code that should be run in the new thread goes here ***
[pool release];
}
网络安全 2009FLY文摘,正正博客 WWW.2009FLY.COM
/***What if you need to do something to the main thread from inside your new thread
*(for example, show a loading //symbol)? Use *performSelectorOnMainThread.
**/
[self performSelectorOnMainThread:@selector(myMethod)withObject:nil waitUntilDone:false];
// Look in Documents for an existing plist file
iphone代码
NSArray *paths = NSSearchPathForDirectoriesInDomains( NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
myPlistPath = [documentsDirectory stringByAppendingPathComponent:
操作系统内核 2009FLY文摘,正正博客 WWW.2009FLY.COM
[NSString
stringWithFormat:
@"%@.plist",
plistName]
];
[myPlistPath retain];
// If it's not there, copy it from the bundle
iphone代码
NSFileManager *fileManger = [NSFileManager defaultManager];
if ( ![fileManger fileExistsAtPath:myPlistPath] )
{
NSString *pathToSettingsInBundle = [[NSBundle mainBundle]
pathForResource:plistName
ofType: 操作系统内核 2009FLY文摘,正正博客 WWW.2009FLY.COM
@"plist"];
}
//Now read the plist file from Documents
iphone代码
NSArray *paths = NSSearchPathForDirectoriesInDomains( NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectoryPath = [paths objectAtIndex:0];
NSString *path = [documentsDirectoryPath stringByAppendingPathComponent:@"myApp.plist"];
NSMutableDictionary *plist = [NSDictionary dictionaryWithContentsOfFile: path];
//Now read and set key/values
iphone代码
myKey = (int)[[plist valueForKey:@"myKey"] intValue];
myKey2 = (bool)[[plist valueForKey:@"myKey2"] boolValue];
[plist setValue:myKey forKey:@"myKey"];
[plist writeToFile:path atomically:YES];
2009FLY文摘,正正博客 WWW.2009FLY.COM
//Alerts Show a simple alert with OK button.
iphone代码
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message: @"An Alert!" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil ];
[alert show];
[alert release];
//Info button
//Increase the touchable area on the Info button, so it's easier to press.
iphone代码
CGRect newInfoButtonRect = CGRectMake(infoButton.frame.origin.x-25, infoButton.frame.origin.y-25,infoButton.frame.size.width+50,infoButton.frame.size.height+50);
[infoButton setFrame:newInfoButtonRect];
//Detecting Subviews
//You can loop through subviews of an existing view. This works especially well if you use the "tag"
property on your views.
内容来自www.2009fly.com 2009FLY文摘,正正博客 WWW.2009FLY.COM
iphone代码
for (UIImageView *anImage in [self.view subviews])
{
if (anImage.tag == 1)
{
// do something
}
}
//创建一个UIView对象
UIView *myview = [[UIView alloc] init];
//设置UIView对象的外观大小
myview.frame = CGRectMake(0, 0, 320, 47);
//设置UIView对象的背景色。 [UIColor colorWithPatternImage:[UIImage imageNamed:@"0006.png"]] 从图片中创建颜色
myview.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"0006.png"]];
//设置cell被选中时的颜色
cell.selectedBackgroundView = myview;
在数字键盘上添加button:
iphone代码
//定义一个消息中心
//addObserver:注册一个观察员 name:消息名称
游戏编程 2009FLY文摘,正正博客 WWW.2009FLY.COM
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(keyboardWillShow:)
name:UIKeyboardWillShowNotification object:nil];
//定义的动作
- (void)keyboardWillShow:(NSNotification *)note {
// 创建一个自定义的UIButton对象
UIButton *doneButton = [UIButton buttonWithType:UIButtonTypeCustom];
//设置UIButton大小的外观大小
doneButton.frame = CGRectMake(0, 163, 106, 53);
//设置该UIButton对象在正常状态下显示的图片
[doneButton setImage:[UIImage imageNamed:@"5.png"] forState:UIControlStateNormal];
//注册事件
[doneButton addTarget:self action:@selector(addRadixPoint) forControlEvents:UIControlEventTouchUpInside]; 移动开发,Android、iPhone 2009FLY文摘,正正博客 WWW.2009FLY.COM
// locate keyboard view取得UIWindow对象
UIWindow* tempWindow = [[[UIApplication sharedApplication] windows] objectAtIndex:1];UIView* keyboard;
//遍历window上的所有subview
for(int i=0; i<[tempWindow.subviews count]; i++)
{
keyboard = [tempWindow.subviews objectAtIndex:i];
// keyboard view found; add the custom button to it //如果该subview是键盘,就在该键盘上添加创建的button 对象
if([[keyboard description] hasPrefix:@"<UIKeyboard"] == YES)
[keyboard addSubview:doneButton];
}
}
正则表达式使用:
被用于正则表达式的字串必须是可变长的,不然会出问题 内容来自www.2009fly.com 2009FLY文摘,正正博客 WWW.2009FLY.COM
将一个空间放在视图之上.above:在什么之上的意思
iphone代码
[scrollView insertSubview:searchButton aboveSubview:scrollView];
从本地加载图片
iphone代码
//取得当前应用程序的束--[NSBundle mainBundle]
//取得资源的路径
NSString *boundle = [[NSBundle mainBundle] resourcePath];
[web1 loadHTMLString:[NSString stringWithFormat:@"<img src='0001.png'/>"]
baseURL:[NSURL fileURLWithPath:boundle]];
从网页加载图片并让图片在规定长宽中缩小
iphone代码
[cell.img loadHTMLString:
内容来自www.2009fly.com 2009FLY文摘,正正博客 WWW.2009FLY.COM
[NSString stringWithFormat:@"<html><body><img src='% @'height='90px'width='90px'></body></html>",goodsInfo.GoodsImg]
baseURL:nil
];
将网页加载到webview上通过javascript获取里面的数据,
如果只是发送了一个连接请求获取到源码以后可以用正则表达式进行获取数据
C代码
1. NSString *javaScript1 = @"document.getElementsByName('.u').item(0).value";
2. NSString *javaScript2 = @"document.getElementsByName('.challenge').item(0).value";
3. NSString *strResult1 = [NSString stringWithString:[theWebView stringByEvaluatingJavaScriptFromString:javaScript1]];
4. NSString *strResult2 = [NSString stringWithString:[theWebView stringByEvaluatingJavaScriptFromString:javaScript2]];
内容来自www.2009fly.com 2009FLY文摘,正正博客 WWW.2009FLY.COM
用NSString怎么把UTF8转换成unicode
iphone代码
utf8Str //
NSString *unicodeStr = [NSString stringWithCString:[utf8Str UTF8String] encoding:NSUnicodeStringEncoding];
View自己调用自己的方法:
iphone代码
//黄色段为方法名,和延迟几秒执行.loginToNext:方法名称 。afterDelay:2--延长2秒调用
[self performSelector:@selector(loginToNext) withObject:nil afterDelay:2];
显示图像:
Java代码
CGRect myImageRect = CGRectMake(0.0f, 0.0f, 320.0f, 109.0f);
UIImageView *myImage = [[UIImageView alloc] initWithFrame:myImageRect];
[myImage setImage:[UIImage imageNamed:@"myImage.png"]];
//opaque是否透明
myImage.opaque = YES;
[self.view addSubview:myImage];
内容来自www.2009fly.com 2009FLY文摘,正正博客 WWW.2009FLY.COM
[myImage release];
WebView:
iphone代码
CGRect webFrame = CGRectMake(0.0, 0.0, 320.0, 460.0);
UIWebView *webView = [[UIWebView alloc] initWithFrame:webFrame];
[webView setBackgroundColor:[UIColor whiteColor]];
NSString *urlAddress = @"http://www.google.com";
NSURL *url = [NSURL URLWithString:urlAddress];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[webView loadRequest:requestObj];
[self addSubview:webView];
[webView release];
显示网络活动状态指示符
这是在iPhone左上部的状态栏显示的转动的图标指示有背景发生网络的活动。
iphone代码
内容来自www.2009fly.com 2009FLY文摘,正正博客 WWW.2009FLY.COM
UIApplication* app = [UIApplication sharedApplication];
app.networkActivityIndicatorVisible = YES;
动画:一个接一个地显示一系列的图象
iphone代码
NSArray *myImages = [NSArray
arrayWithObjects:
[UIImage imageNamed:@"myImage1.png"],
[UIImage imageNamed:@"myImage2.png"],
[UIImage imageNamed:@"myImage3.png"],
[UIImage imageNamed:@"myImage4.gif"],
nil];
//创建一个UIImageView对象
2009FLY文摘,正正博客 WWW.2009FLY.COM
UIImageView *myAnimatedView = [UIImageView alloc];
//初始化UIImageView对象的大小
[myAnimatedView initWithFrame:[self bounds]];
//animationImages属性返回一个存放动画图片的数组
myAnimatedView.animationImages = myImages;
//浏览整个图片一次所用的时间
myAnimatedView.animationDuration = 0.25;
// 0 = loops forever 动画重复次数
myAnimatedView.animationRepeatCount = 0;
//开始动画
[myAnimatedView startAnimating];
//把该UIImageView对象添加到view视图中
[self addSubview:myAnimatedView];
//释放
[myAnimatedView release];
动画:显示了something在屏幕上移动。
注:这种类型的动画是“开始后不处理” -你不能获取任何有关物体在动画中的信息(如当前的位置) 。
内容来自www.2009fly.com 2009FLY文摘,正正博客 WWW.2009FLY.COM
如果您需要此信息,您会手动使用定时器去调整动画的X和Y坐标
这个需要导入QuartzCore.framework
Java代码
CABasicAnimation *theAnimation;
theAnimation=
[CABasicAnimation animationWithKeyPath:@"transform.translation.x"];
//Creates and returns an CAPropertyAnimation instance for the specified key path.
//parameter:the key path of the property to be animated
theAnimation.duration=1;
theAnimation.repeatCount=2;
theAnimation.autoreverses=YES;
theAnimation.fromValue=[NSNumber numberWithFloat:0];
theAnimation.toValue=[NSNumber numberWithFloat:-60];
[view.layer addAnimation:theAnimation forKey:@"animateLayer"];
游戏编程 2009FLY文摘,正正博客 WWW.2009FLY.COM
Draggable items//拖动项目
Here's how to create a simple draggable image.//这是如何生成一个简单的拖动图象
iphone代码
1. Create a new class that inherits from UIImageView
@interface myDraggableImage : UIImageView
{
}
2. In the implementation for this new class, add the 2 methods:
- (void) touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event
{
// Retrieve the touch point 检索接触点 游戏编程 2009FLY文摘,正正博客 WWW.2009FLY.COM
CGPoint pt = [[touches anyObject] locationInView:self];
startLocation = pt;
[[self superview] bringSubviewToFront:self];
}
- (void) touchesMoved:(NSSet*)touches withEvent:(UIEvent*)event
{
// Move relative to the original touch point 相对以前的触摸点进行移动
CGPoint pt = [[touches anyObject] locationInView:self];
CGRect frame = [self frame];
frame.origin.x += pt.x - startLocation.x;
frame.origin.y += pt.y - startLocation.y;
[self setFrame:frame];
}
3. Now instantiate the new class as you would any other new image and add it to your view copyright 2009fly 2009FLY文摘,正正博客 WWW.2009FLY.COM
//实例这个新的类,放到你需要新的图片放到你的视图上
dragger = [[myDraggableImage alloc] initWithFrame:myDragRect];
[dragger setImage:[UIImage imageNamed:@"myImage.png"]];
[dragger setUserInteractionEnabled:YES];
线程:
Java代码
1. Create the new thread:
[NSThread detachNewThreadSelector:@selector(myMethod)toTarget:self withObject:nil];
2. Create the method that is called by the new thread:
- (void)myMethod
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
*** code that should be run in the new thread goes here ***
[pool release];
}
网络安全 2009FLY文摘,正正博客 WWW.2009FLY.COM
/***What if you need to do something to the main thread from inside your new thread
*(for example, show a loading //symbol)? Use *performSelectorOnMainThread.
**/
[self performSelectorOnMainThread:@selector(myMethod)withObject:nil waitUntilDone:false];
// Look in Documents for an existing plist file
iphone代码
NSArray *paths = NSSearchPathForDirectoriesInDomains( NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
myPlistPath = [documentsDirectory stringByAppendingPathComponent:
操作系统内核 2009FLY文摘,正正博客 WWW.2009FLY.COM
[NSString
stringWithFormat:
@"%@.plist",
plistName]
];
[myPlistPath retain];
// If it's not there, copy it from the bundle
iphone代码
NSFileManager *fileManger = [NSFileManager defaultManager];
if ( ![fileManger fileExistsAtPath:myPlistPath] )
{
NSString *pathToSettingsInBundle = [[NSBundle mainBundle]
pathForResource:plistName
ofType: 操作系统内核 2009FLY文摘,正正博客 WWW.2009FLY.COM
@"plist"];
}
//Now read the plist file from Documents
iphone代码
NSArray *paths = NSSearchPathForDirectoriesInDomains( NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectoryPath = [paths objectAtIndex:0];
NSString *path = [documentsDirectoryPath stringByAppendingPathComponent:@"myApp.plist"];
NSMutableDictionary *plist = [NSDictionary dictionaryWithContentsOfFile: path];
//Now read and set key/values
iphone代码
myKey = (int)[[plist valueForKey:@"myKey"] intValue];
myKey2 = (bool)[[plist valueForKey:@"myKey2"] boolValue];
[plist setValue:myKey forKey:@"myKey"];
[plist writeToFile:path atomically:YES];
2009FLY文摘,正正博客 WWW.2009FLY.COM
//Alerts Show a simple alert with OK button.
iphone代码
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message: @"An Alert!" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil ];
[alert show];
[alert release];
//Info button
//Increase the touchable area on the Info button, so it's easier to press.
iphone代码
CGRect newInfoButtonRect = CGRectMake(infoButton.frame.origin.x-25, infoButton.frame.origin.y-25,infoButton.frame.size.width+50,infoButton.frame.size.height+50);
[infoButton setFrame:newInfoButtonRect];
//Detecting Subviews
//You can loop through subviews of an existing view. This works especially well if you use the "tag"
property on your views.
内容来自www.2009fly.com 2009FLY文摘,正正博客 WWW.2009FLY.COM
iphone代码
for (UIImageView *anImage in [self.view subviews])
{
if (anImage.tag == 1)
{
// do something
}
}
发表评论
-
XCode 下的svn配置[转]
2011-08-03 17:13 3492团队开发时,需要使用版本管理辅助我们来管理代码,提高效率。 ... -
iPhone 面试题解答
2011-08-03 16:51 1793main() { int a[5]={1,2, ... -
NSRunLoop概述和原理[转]
2011-08-03 15:53 15931.什么是NSRunLoop? 我们 ... -
iphone 开发参考网站[补充中]
2011-08-03 15:26 1103把自己在学习iphone开发中比较好的参考网站做下记录: ... -
iPad app应用开发系列文章之三 -- iOS的多核编程和内存管理[转]
2011-08-03 13:15 1713隔上一次写iPad app开发 ... -
iPad app 开发概述 - iPad开发系列文章之二[转]
2011-08-03 13:07 1387随着iNotes的第一版完成,我近期的工作也从xcode开发转 ... -
iNotes? 为什么要开发iNotes? (iPad开发系列文章一)[转]
2011-08-03 13:05 1676没有上来写东西n久了。 ... -
IOS开发的一些技巧和常见问题[转]
2011-08-02 16:20 24971.timer使用注意在使用uis ... -
iPhone应用程序委托
2011-08-02 11:00 1416iPhone的软件栈有好几层组成,而应用程序是位于栈里面 ... -
gethostbyname的用法
2011-08-01 14:58 0使用这个东西,首先要包含2个头文件: #include < ... -
解决Xcode 4.0.1 and iOS SDK4.3安装后无法启动Xcode!
2011-07-23 22:39 7218我是用虚拟机安装的Mac OS X 10.6.6并更新到10. ... -
window7 64位 华硕A53虚拟机Virtualbox安装mac系统及xcode
2011-07-23 15:45 10288关于如何安装virtualbox及 ... -
Xcode 快捷键大全
2011-06-22 16:37 2763Xcode 快捷键大全 收藏 现在说明一下,comman ...
相关推荐
iphone常用代码段,适合新手学习使用
Iphone_开发常用代码 非常详细 应有尽有
ios 开发常用代码ios 开发常用代码
iphone开发中日常应用小结,iphone开发常用代码
iphone开发常用json解析的详细讲解,配合代码,一看即懂!
一些简单的操作针对iphone开发的 包括对时间 旋转 以及一些常有类的用法
博文http://blog.csdn.net/m_changgong/article/details/8107957源代码
iPhone应用开发从入门到精通作者:杨帆 郑青青 王凤筱 编著前 言入 门 篇第1章 iPhone OS介绍 21.1 iPhone OS预览21.1.1 iPhone OS的发展历史21.1.2 iPhone OS的外观31.1.3 多任务特性31.1.4 不支持的技术...
博文http://blog.csdn.net/m_changgong/article/details/8115137源代码
本书面向新的iPhone 开发人员,他们马上要开发实际项目,但面对着一个全新的SDK。虽然每位程 序员创建表格的目标和经验并不相同,但大多数人都需要在其开发工作中解决类似的任务:如何构建表格, 如何创建安全的密钥...
本书面向新的iPhone 开发人员,他们马上要开发实际项目,但面对着一个全新的SDK。虽然每位程 序员创建表格的目标和经验并不相同,但大多数人都需要在其开发工作中解决类似的任务:如何构建表格, 如何创建安全的密钥...
本书面向新的iPhone 开发人员,他们马上要开发实际项目,但面对着一个全新的SDK。虽然每位程 序员创建表格的目标和经验并不相同,但大多数人都需要在其开发工作中解决类似的任务:如何构建表格, 如何创建安全的密钥...
博文http://blog.csdn.net/m_changgong/article/details/8112404源代码
常用目录 114 备份和恢复 115 在应用程序更新过程中被保存的文件 116 Keychain数据 116 获取应用程序目录的路径 117 文件数据的读写 118 文件访问的指导原则 123 保存状态信息 123 大小写敏感性 124 网络 124 有效...
本书由资深iOS开发工程师精心编撰,系统地介绍了使用iOS 10+Swift 3+Xcode 8开发移动...本书适合iOS开发新手、iOS程序员、iPhone开发人员、iPad开发人员使用,也可以作为相关培训机构和大专院校相关专业的教学用书。
来源:github/YUKitLicence:MIT作者:空白待抒写 针对常用开发框架的一些类别和扩展,方便快速开发 本库采用ARC