摘要: if ([[[UIDevice currentDevice] systemVersion] floatValue]>=7) { [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; self.window.frame=CGRectMake(0, 20, self.window.frame.size.width, self.window.frame.size.height-20); }info.plist加入View controller-based... 阅读全文
posted @ 2013-10-09 14:03 Asial 阅读(255) 评论(0) 推荐(0) 编辑
摘要: 电池状态栏。//方法一(代码设置):现在ios7已经更改为透明,并且不占用屏幕高度。其中隐藏及显示的方法如下:在uiviewcontroller的子类下,调用: if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) { // iOS 7 [self prefersStatusBarHidden]; [self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)]; }- (BOO... 阅读全文
posted @ 2013-09-29 09:59 Asial 阅读(1144) 评论(0) 推荐(0) 编辑
摘要: 做了一个单选勾选的表之前有些问题,修改了一下.h文件@interface ViewController : UIViewController{ NSArray *arrry; NSInteger checkedIndexPath; }@end- (void)viewDidLoad{ [super viewDidLoad]; UITableView *atable=[[UITableView alloc] initWithFrame:CGRectMake(0, 0, 320, 350)]; atable.delegate=self; atable.dataS... 阅读全文
posted @ 2013-09-27 09:21 Asial 阅读(396) 评论(0) 推荐(0) 编辑
摘要: 自定义一个跟随手指的小球DrawView.java文件import android.content.Context;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.util.AttributeSet;import android.view.MotionEvent;import android.view.View;public class DrawView extends View{ public float curr... 阅读全文
posted @ 2013-09-22 22:21 Asial 阅读(247) 评论(0) 推荐(1) 编辑
摘要: JSONKit有两个warning。// array->isa = _JKArrayClass;// warningobject_setClass(array, _JKArrayClass); // 更正dictionary->isa = _JKDictionaryClass;// warningobject_setClass(dictionary, _JKDictionaryClass);// 更正原因isa已经被废弃了,所以请调用object_setClass()和object_getClass() 阅读全文
posted @ 2013-09-17 18:57 Asial 阅读(273) 评论(0) 推荐(0) 编辑
摘要: 1.当前View画成Image- (UIImage *) imageWithUIView:(UIView*) view{ UIGraphicsBeginImageContext(view.bounds.size); CGContextRef ctx = UIGraphicsGetCurrentContext();[view.layer renderInContext:ctx];UIImage* tImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return tImage;}... 阅读全文
posted @ 2013-09-16 19:50 Asial 阅读(266) 评论(0) 推荐(0) 编辑
摘要: 1.SourceForgeSF为大家所熟知,开源项目的大本营,SF托管至少28万个开源项目,一天的下载量超过200万。2.GitHubGitHub托管使用Git版本控制系统的公开和私有项目。 目前该网站托管超过170万存储项目,包括许多开源软件。3.Google CodeGoogle提供免费的使用Subversion或是Mercurial版本控制系统的开源项目托管服务。 它提供2G的存储空间,整合了代码查看工具、wiki、问题跟踪。Google Code站点也提供了大量的Googe自己的APIs和其他开发工具。4.Eclipse Labs同样由Google Code托管, Eclipse La 阅读全文
posted @ 2013-08-16 22:49 Asial 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 因为项目中要用到左右滑动进每个页面的下一级,用到了给cell添加手势代码如下 UISwipeGestureRecognizer *recognizer; recognizer = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(handleSwipeFrom:)]; [recognizer setDirection:(UISwipeGestureRecognizerDirectionLeft)]; [cell.contentView addGestureRecognize... 阅读全文
posted @ 2013-08-13 20:28 Asial 阅读(336) 评论(0) 推荐(0) 编辑
摘要: 本文转自:http://www.cocoachina.com/bbs/read.php?tid=51242ASIHTTPRequest是一款极其强劲的HTTP访问开源项目。让简单的API完成复杂的功能,如:异步请求,队列请求,GZIP压缩,缓存,断点续传,进度跟踪,上传文件,HTTP认证在新的版本中,还加入了Objective-C闭包Block的支持,让我们的代码更加轻简灵活。下面就举例说明它的API用法。发起一个同步请求同步意为着线程阻塞,在主线程中使用此方法会使应用Hang住而不响应任何用户事件。所以,在应用程序设计时,大多被用在专门的子线程增加用户体验,或用异步请求代替(下面会讲到)。- 阅读全文
posted @ 2013-08-12 17:01 Asial 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 可以在预编译文件pch里面,生成全局的宏#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)#define HeightFOR5 548#define HeightFOR4 460#define Width 320 阅读全文
posted @ 2013-08-12 16:45 Asial 阅读(157) 评论(0) 推荐(0) 编辑