- 博客(19)
- 收藏
- 关注
原创 UICollectionView
- (void)viewDidLoad { [super viewDidLoad]; mytable =[[UITableView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT-69-49)]; mytable.backgroundColor =[UIColor whiteColor];
2016-03-30 17:33:00 342
转载 AppDelegate
AppDelegate.m 接口所在的文件,常见接口有: application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions//应用程序启动后,要执行的委托调用 applicationWillResignActive:(UIApplication *)application//应用程序将
2016-03-30 10:17:17 366
原创 JPush相关总结
1,收到推送后的处理- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
2016-03-30 09:48:26 405
转载 禁止scrollview上下拖动
在最近的学习中发现,scrollView有时候可以上下左右拖动,效果很是不好。具体触发的原因可能有许多种,本篇介绍本人遇见的一种,并提供解决办法/* scrollVIew加在一个已经加了UINavigationController和tabBarViewController 的ViewController里.如果scrollVIew的contentSize的高度是整个屏幕则会
2016-03-24 09:57:04 2068
转载 状态栏和导航栏默认高度
// 状态栏(statusbar) CGRect rectStatus = [[UIApplication sharedApplication] statusBarFrame]; NSLog(@"status width - %f", rectStatus.size.width); // 宽度 NSLog(@"status height - %f", rectS
2016-03-23 15:55:40 1879
转载 怎么根据tag值取出相应的控件
//根据tag查找UILabel *find_label = (UILabel *)[self.view viewWithTag:123]; find_label.backgroundColor = [UIColor redColor];我觉得在循环 遍历用tag标记,查找比较常见//另一种根据tag查找for (UIView *find_label in self.
2016-03-18 14:07:46 9464
转载 ios button 图标和文字位置设置
文字button.contentVerticalAlignment = UIControlContentVerticalAlignmentBottom;button. contentHorizontalAlignment =UIControlContentHorizontalAlignmentLeft;图标[button setImage:[UIImage imageNamed
2016-03-18 08:59:39 882
原创 字符串以XX开头或结尾
// 字符串开头是否包括另一字符串 hasPrefix,返回结果YES(true) BOOL isHas = [str hasPrefix:@"This"]; // 字符串结尾是否包括另一字符串 hasSuffix,返回结果YES(true) BOOL isHas = [str hasSuffix:@"John"];
2016-03-17 10:44:54 1495
转载 MD5加密
+(NSString *) md5: (NSString *) inPutText { const char *cStr = [inPutText UTF8String]; unsigned char result[CC_MD5_DIGEST_LENGTH]; CC_MD5(cStr, strlen(cStr), result); return [[NS
2016-03-17 09:50:02 293
原创 MJRefresh的简单使用
需要#import "MJRefresh.h"//下拉刷新 mytable.mj_header= [MJRefreshNormalHeader headerWithRefreshingBlock:^{ // 模拟延迟加载数据,因此2秒后才调用(真实开发中,可以移除这段gcd代码) dispatch_after(dispatch_time(DISP
2016-03-16 17:08:20 437
原创 从后台下载语音/视频并播放
//获取信息NSData* data = [NSData dataWithContentsOfURL:[NSURL URLWithString:url]];//保存到本地NSString * str =[NSString stringWithFormat:@"%@/Library/Cache/Audios/%@.mp3",NSHomeDirectory(),[url md5He
2016-03-16 16:56:09 786
原创 MOV转MP4格式
AVURLAsset *avAsset = [AVURLAsset URLAssetWithURL:[[fieldData objectAtIndex:0]objectForKey:@"videopath"] options:nil]; NSArray *compatiblePresets = [AVAssetExportSession exportPresetsCompatibleWit
2016-03-16 16:02:43 1005
转载 视频录制控件
// 视频录制#import "ZcMovieViewController.h"#import #import #import "HIVideoViewController.h"typedef void(^PropertyChangeBlock)(AVCaptureDevice *captureDevice);@interface ZcMovieViewController ()
2016-03-16 15:58:58 581
原创 ios 本地通知
//发送通知(Name:判断通知的身份,userinfo:字典中存储数据再通知中发出去)NSNotification * notice = [NSNotificationnotificationWithName:@"GetRecordData"object:niluserInfo:@{@"fileId":fileUrl1}];[[NSNotificationCenter
2016-03-15 16:02:02 718
转载 iOS开发-文件管理
iOS开发-文件管理(一)一、iOS中的沙盒机制iOS应用程序只能对自己创建的文件系统读取文件,这个独立、封闭、安全的空间,叫做沙盒。它一般存放着程序包文件(可执行文件)、图片、音频、视频、plist文件、sqlite数据库以及其他文件。每个应用程序都有自己的独立的存储空间(沙盒)一般来说应用程序之间是不可以互相访问模拟器沙盒的位
2016-03-11 10:58:56 303
原创 popToRootViewControllerAnimated:(BOOL)animated
for(UIViewController *controller in self.navigationController.viewControllers){ if([controller isKindOfClass:[HIHomepageController class]]){ HIHomepageController*owr = (HIHomepageC
2016-03-04 17:37:10 620
原创 ios 视频录制与播放
视频录制//拍小视屏 UIImagePickerController *picker =[[UIImagePickerController alloc]init]; picker.sourceType =UIImagePickerControllerSourceTypeCamera; NSArray *arrMediaTy
2016-03-03 11:04:32 886
原创 ios 粘贴功能
pasteStr =[NSString stringWithFormat:@"%@",[[UIPasteboard generalPasteboard]string]];
2016-03-01 09:52:14 616
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人