本文是博主 iOS 开发实践系列中的一篇,主要讲述 iOS 中 Auto Layout(自动布局)在实际项目中的使用。 Auto Layout 在 2012 年的 iOS 6 中发布,距今已经 2
IOS中对图片进行重绘处理的方法总结 一、CGImageRef是什么 CGImageRef是定义在 QuartzCore框架中的一个结构体指针,用C语言编写。在CGImage.h文件中,我们可以看到下面的定义:
简单和直观的iOS图表库。支持贡献图,时钟图和条形图。 Contribution Graph The contribution graph mimics the GitHub one. You
Android/iOS视频播放器,基于FFmpeg n2.6, 包含MediaCodec, VideoToolbox 支持。 特性 Common remove rarely used ffmpeg components
分分钟搞定IOS远程消息推送 一、引言 IOS中消息的推送有两种方式,分别是本地推送和远程推送,本地推送在 http://my.oschina.net/u/2340880/blog/405491
本文首先发布在微信公众号 codeKK Yalantis 致力于提供世界一流的 Android 和 iOS 应用开发服务,因一些动画很棒的开源库为大家所熟知,这里整理下他们的主要开源库。 1. ContextMenu
想在程序 开始或者进入某个界面,到结束程序或退出某个界面,获取到这个持续时间.获取到这个时间还需要转化一个取得时分秒. startTime == 全局变量 NSString *startTime; //开始的地方调用 -(NSString*)getCurrentTime{ NSDateFormatter *formatter = [[NSDateFormatteralloc] init]; [fo
#pragma mark -发送短信 @interface ViewController () { UIAlertView *mfAlertview;//定义一个弹出框 } -(void)showMessageViewController { if( [MFMessageComposeViewController canSendText] )//判断是否能发短息 { MFMessageCompos
- (void)textFieldDidBeginEditing:(UITextField *)textField{ NSArray *ws = [[UIApplication sharedApplication] windows]; for(UIView *w in ws){ NSArray *vs = [w subviews]; for(UIView *v in vs){ if([[NSStr
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [application setMinimumBackgroundFetchInterval:UIApplicationBackgroundFetchIntervalMinimu
@interface UIImage (Resize) //按形状切割图像 - (UIImage*)cutImageWithRadius:(int)radius; @end //图片剪切 - (UIImage*)cutImageWithRadius:(int)radius { UIGraphicsBeginImageContext(self.size); CGContext
1.导入库文件MediaPlayer.framework 2.#import<MediaPlayer/MediaPlayer.h> // 本地文件 NSURL *url = [[NSBundle mainBundle] URLForResource:@"xxxxxxxxxxxxxxx" withExtension:@"mov"]; // 沙盒中的网络路径 (注意这两种方式的区别) NSURL *v
- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. self.imageView = [[UIImageView alloc] initWithFrame:CGRectMake(60, 100, 200, 300)]; _imageView.image = [UI
navigationController.navigationBarHidden = YES;// iOS开发之UIlabel多行文字自动换行 (自动折行) UIView *footerView = [[UIView
处理UILabel根据文字长度和大小自动适应宽度和高度 //这个frame是初设的,没关系,后面还会重新设置其size。 UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0,0,0,0)]; label.numberOfLines = 0; label.backgroundColor = [UIColor clearColor]
在现在的很多智能手机中,内置了很多的传感器,我们开发的很多App都可以根据传感器的信息开发出交互性更加强的应用。现在我们先来iOS中使用并获取加速度传感器。 (1)代码实现如下: import UIKit import CoreMotion
1 调用相机并且上传照片的方法 #import "ViewController.h" #import "AFNetworking.h" @interface ViewController () <UIActionSheetDelegate,UIImagePickerControllerDelegate,UINavigationControllerDelegate> @property (wea
实现原理比较简单,这里不做过多介绍. #import "ViewController.h" @interface ViewController () @property (weak, nonatomic) IBOutlet UILabel *titleLabel; @property (copy , nonatomic)NSString *contentStr; @end - (void)view
TARGET_IPHONE_SIMULATOR // iPhone Device #endif ios设备版本的区分-iphone3gs,iphone4.... ios提供了几种c函数来获得相应信息如下 struct utsname
- (void) fadeOut: (id) sender { CGContextRef context = UIGraphicsGetCurrentContext(); [UIView beginAnimations:nil context:context]; [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [UIView se