摘要: 首先自定义view+ (UIView *) changeViewTitleFontSize:(NSString *)strTitle;{ //自定义标题 UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0 , 100, 44)]; titleLabel.backgroundColor = [UIColor clearColor]; titleLabel.font = [UIFont fontWithName: @"Helvetica" size: 14.0]; titleLabe... 阅读全文
posted @ 2014-01-08 11:11 暖流 阅读(401) 评论(0) 推荐(0) 编辑
摘要: 首先.h文件添加UIGestureRecognizerDelegate //长按设置情景模式 UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPressShowView:)]; [self.view addGestureRecognizer:longPress]; [longPress release]; UITapGestureRecognizer* single... 阅读全文
posted @ 2014-01-07 17:35 暖流 阅读(2120) 评论(0) 推荐(0) 编辑
摘要: 跳转模态视图兼容ios5,ios4.3- (void)setWirless{ ConfigureWirelessViewController *vcConfigureWireless = [[ConfigureWirelessViewController alloc] init]; vcConfigureWireless.m_delegateConfigureWireless = self; //创建Nav UINavigationController *navSetWireless = [[UINavigationController alloc] initW... 阅读全文
posted @ 2014-01-07 10:36 暖流 阅读(547) 评论(0) 推荐(0) 编辑
摘要: UIImage *img = [UIImage imageNamed:@"write_operation_bg.png"];UIImage *imgNew = [img stretchableImageWithLeftCapWidth:20 topCapHeight:20];宽高拉伸20像素 阅读全文
posted @ 2014-01-06 11:12 暖流 阅读(112) 评论(0) 推荐(0) 编辑
摘要: //.h,导入,并添加delegate#import RBDMuteSwitchDelegate//.m//检测当前是否为静音[[RBDMuteSwitch sharedInstance] setDelegate:self];[[RBDMuteSwitch sharedInstance] detectMuteSwitch];//检测是否静音(震动)#pragma mark - - (void)isMuted:(BOOL)muted{ if (muted) { //静音 } else { //正常,设置音量 MPMusicP... 阅读全文
posted @ 2013-12-23 16:53 暖流 阅读(361) 评论(0) 推荐(0) 编辑
摘要: [[UIApplication sharedApplication] setIdleTimerDisabled: YES];或者[UIApplication sharedApplication].idleTimerDisabled = YES;这样可以有效的控制不允许锁屏,点赞~~ 阅读全文
posted @ 2013-12-17 10:35 暖流 阅读(462) 评论(0) 推荐(0) 编辑
摘要: 一//调用if(m_viewScenario.superview == nil){ m_viewScenario.alpha = 1.0; m_viewScenario.transform = CGAffineTransformIdentity; [self zoomIn:m_viewScenario andAnimationDuration:1.0 andWait:YES]; [self.view addSubview:m_viewScenario];} //展示,由小变大- (void)zoomIn: (UIView *)view andAnimationDura... 阅读全文
posted @ 2013-12-09 16:04 暖流 阅读(8254) 评论(0) 推荐(0) 编辑
摘要: 正则表达式获取标签内容 NSString *zz = @".*].*?)/>.*";// NSString *string2 = @"PHA+YXNkPC9wPjxyZWNvcmRfY29uZmlnDQp0cmlnZ2VyX21vZGU9IjAiIHJlY29yZGluZ19tb2RlPSIwIiBlbmFibGVfb3NkPSIwIiBtdXhhdWRpbz0iMSINCm5ldGRpc2tfYmFpZHVfZW5hYmxlPSIxMDc5OTk4NDE2IiBuZXRkaXNrX2JhaWR1X3Rva2VuPSIxCSIgLz4NCjxsc2gyNjR 阅读全文
posted @ 2013-12-09 10:31 暖流 阅读(186) 评论(0) 推荐(0) 编辑
摘要: NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; NSDateComponents *comps = nil; comps = [calendar components:NSYearCalendarUnit|NSMonthCalendarUnit|NSDayCalendarUnit fromDate:mydate]; NSDateComponents *adcomps = [[NSDateComponents alloc] init]; ... 阅读全文
posted @ 2013-12-07 21:59 暖流 阅读(445) 评论(0) 推荐(0) 编辑
摘要: 1,- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions下添加 //安装异常捕获#ifdef DEBUG [NSThread detachNewThreadSelector:@selector(startCatchException) toTarget:self withObject:nil];#endif2,- (void)startCatchException{ NSAutoreleasePool *pool ... 阅读全文
posted @ 2013-12-06 15:34 暖流 阅读(1422) 评论(0) 推荐(0) 编辑
摘要: NSThread 有两种直接创建方式:- (id)initWithTarget:(id)targetselector:(SEL)selectorobject:(id)argument+ (void)detachNewThreadSelector:(SEL)aSelectortoTarget:(id)aTargetwithObject:(id)anArgument[NSThread detachNewThreadSelector:@selector(doSomething:) toTarget:self withObject:nil];NSThread* myThread = [[NSThrea 阅读全文
posted @ 2013-12-05 19:04 暖流 阅读(232) 评论(0) 推荐(0) 编辑
摘要: 1.在viewController下面添加如下代码: if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) { [self prefersStatusBarHidden]; [self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)]; }- (BOOL)prefersStatusBarHidden{ return YES;}2.在plist里设置:首先设置key:Status bar is initially hid... 阅读全文
posted @ 2013-12-04 10:29 暖流 阅读(265) 评论(0) 推荐(0) 编辑
摘要: Xcode更新到Xcode5,一运行报如下错误:Unsupported compiler 'com.apple.compilers.llvmgcc42' selected for architecture 'armv7'或'armv7s'解决方案:Change your compiler for C/C++/ObjectiveC Go to Build Settings->Build OPtions->compiler for C/C++/ObjectiveC; select Default(Apple LLVM5.0) 阅读全文
posted @ 2013-12-04 10:26 暖流 阅读(2900) 评论(0) 推荐(0) 编辑
摘要: UIActionSheet最后一个按钮没响应,一般是cancelButton,要稍微向上偏移一点才可以。不过这不是常态,几乎没多少人碰到这个问题,这是在特定情况下才会发生,这个场景就是试用了UITabBar的时候才有。参考:http://stackoverflow.com/questions/2096852/iphone-weird-bug-between-uiactionsheet-and-uitabbar解决办法: UIActionSheet *action = [[UIActionSheet alloc] initWithTitle:@"您是否拨打" ... 阅读全文
posted @ 2013-12-03 16:59 暖流 阅读(169) 评论(0) 推荐(0) 编辑
摘要: void FFDecoder::setupScaler(){// sws_freeContext(img_convert_ctx); // Allocate RGB picture avpicture_alloc(&picture, PIX_FMT_RGB24, pCodecCtx->width , pCodecCtx->height); // Setup scaler static int sws_flags = SWS_FAST_BILINEAR; img_convert_ctx = sws_getContext(pCodecCtx->width, pCodec. 阅读全文
posted @ 2013-11-28 15:04 暖流 阅读(2401) 评论(0) 推荐(0) 编辑
摘要: //注意此处坐标从数组提取**********CGRect tappingArea=[[tapArea_Paigu objectAtIndex:i] CGRectValue];//CGRectIntersectsRect bool型函数 判断 tappingArea是否在touchArea内。。CGRectIntersectsRect(touchArea,tappingArea); - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ UITouch *touch = [touches anyObject];... 阅读全文
posted @ 2013-11-27 17:32 暖流 阅读(407) 评论(0) 推荐(0) 编辑
摘要: txtfield点击出现pickerviewif (txtField.tag == 301) { [txtField resignFirstResponder]; UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"" delegate:self ... 阅读全文
posted @ 2013-11-22 13:16 暖流 阅读(13782) 评论(0) 推荐(0) 编辑
摘要: //// SensorAddDeleteViewController.m// Abviewer_iPhone//// Created by Ken.zhao on 13-11-20.// Copyright (c) 2013年 sven. All rights reserved.//#import "SensorAddDeleteViewController.h"#import "ABServices.h"#import "FormatWeekListViewController.h"@interface SensorAddDelet 阅读全文
posted @ 2013-11-21 10:18 暖流 阅读(5878) 评论(0) 推荐(0) 编辑
摘要: if (IOS5) { [self presentViewController:navWeibo animated:YES completion:nil]; } else { [self presentModalViewController... 阅读全文
posted @ 2013-11-18 16:24 暖流 阅读(326) 评论(0) 推荐(0) 编辑
摘要: .h#import @interface WeiboUserInfo : NSObject{ NSString *m_strDeviceJid; //绑定的设备的jid NSString *m_strDevicePwd; //绑定的设备的password NSString *m_strSinaJid; //sina帐号的jid NSString *m_strSinaPasswd; //sina帐号密码 NSString *m_strNickName; //sina帐号的昵称 NSString *m_strSinaB... 阅读全文
posted @ 2013-11-18 16:13 暖流 阅读(6077) 评论(1) 推荐(0) 编辑
摘要: //私有API,目前appstore可以审核通过了(iphone目前没问题,但是ipad会出现图片变形)CGImageRef img = UIGetScreenImage(); UIImage* scImage=[UIImage imageWithCGImage:img]; UIImageWriteToSavedPhotosAlbum(scImage, self, @selector(image:didFinishSavingWithError:contextInfo:), nil); 下面这种截图,保存上下文(如果是yuv视频数据是无法直接保存,方法:视频数据时,可以采用yuv转... 阅读全文
posted @ 2013-11-15 14:33 暖流 阅读(527) 评论(0) 推荐(0) 编辑
摘要: - (void)showBaiduNetdiskFullAlarmView{ UITextField *textField = (UITextField *)objc_getAssociatedObject(self, &kNSStringBaiduNetdiskFullViewTag); if (textField != nil) { [m_imgViewTabbar addSubview:textField]; } else { UITextField *txtFieldBaidu = [[UITextField alloc]... 阅读全文
posted @ 2013-11-14 17:45 暖流 阅读(833) 评论(0) 推荐(0) 编辑
摘要: //// Base64Tool.h// Abviewer_iPhone//// Created by sven on 13-4-16.// Copyright (c) 2013年 xxx. All rights reserved.//#import #define BASE64FromString( string ) [Base64Tool base64StringFromText:string]#define StringFromBASE64( base64 ) [Base64Tool textFromBase64String:base64]@interf... 阅读全文
posted @ 2013-11-14 09:48 暖流 阅读(2089) 评论(0) 推荐(0) 编辑
摘要: CGGeometry类定义几何元素的结构和操作几何元素的函数。1、数据类型:CGFloat: 浮点值的基本类型CGPoint: 表示一个二维坐标系中的点CGSize: 表示一个矩形的宽度和高度CGRect: 表示一个矩形的位置和大小typedef float CGFloat;// 32-bittypedef double CGFloat;// 64-bitstruct CGPoint { CGFloat x; CGFloat y;};typedef struct CGPoint CGPoint;struct CGSize { CGFloat width; CGFloat... 阅读全文
posted @ 2013-11-11 17:47 暖流 阅读(372) 评论(0) 推荐(0) 编辑
摘要: //获取indexPathNSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];//取消样式[cell setSelectionStyle:UITableViewCellSelectionStyleNone];//闪... 阅读全文
posted @ 2013-11-07 13:37 暖流 阅读(283) 评论(2) 推荐(0) 编辑
摘要: NSDictionary *dic = [NSJSONSerializationJSONObjectWithData:responseObject options:NSJSONReadingAllowFragments error:nil]; //获取当前时区 //判断12/24小时制 //获取NS 阅读全文
posted @ 2013-11-05 11:28 暖流 阅读(408) 评论(0) 推荐(0) 编辑
摘要: //公共函数//.h+ (UIView *) changeNavTitleByFontSize:(NSString *)strTitle;//.m+ (UIView *) changeNavTitleByFontSize:(NSString *)strTitle{ //自定义标题 UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0 , 100, 44)]; titleLabel.backgroundColor = [UIColor clearColor]; titleLabel.fon... 阅读全文
posted @ 2013-10-28 14:24 暖流 阅读(3022) 评论(0) 推荐(0) 编辑
摘要: jsp页面 上传文件地址: 后台接收 //excel文件批量导入短信 @RequestMapping("/importToContent.aa") public ModelAndView importToContent(HttpServletRequest request,@RequestParam("excelFile") MultipartFile file) throws Exception{ scm.readExcelWriteData(file.getInputStream()); return new ModelAndView(... 阅读全文
posted @ 2013-10-25 16:14 暖流 阅读(446) 评论(0) 推荐(0) 编辑
摘要: web.xml中有各种各样的标签,了解一下具体标签的具体用途.1,站点的名称和说明.2,针对环境参数初始化3,Servlet的名称和映射4,Session生命周期的设定5,Tag library的对映6,Jsp的设定7,Mime Type处理8,错误处理9,利用JDNI取得站台资源...等等;这里介绍了这个xml的版本,xml概括的来源xsi:schema...DevelopJSP 2.0 Tech Book's Examples /images/small.gif /images/large.gir站点名称,站点描述,站点小\中图标的路径.元素应指向web站台中某个小图标的路径,大小 阅读全文
posted @ 2013-10-25 16:10 暖流 阅读(286) 评论(0) 推荐(0) 编辑
摘要: //要是真的想转换可以都试试out.println( " 1: "+ "中文 "); out.println( " 2: "+ "中文 ".getBytes()); out.println( " 3: "+ "中文 ".getBytes( "GB2312 ")); out.println( " 4: "+ "中文 ".getBytes( "ISO8859_1 ")); out.println( & 阅读全文
posted @ 2013-10-25 16:03 暖流 阅读(581) 评论(0) 推荐(0) 编辑