![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
iOS
文章平均质量分 55
xiangxx@酷
开朗 爱打台球 羽毛球 运动
展开
-
设置按钮渐变背景色返回UIImage
设置按钮渐变背景色[self.btnSubmit setBackgroundImage:[JLUtility currentGradientColorImageWithSize:CGSizeMake(kJLScreenWidth-40, 48)] forState:UIControlStateNormal];self.btnSubmit.layer.cornerRadius = 24;self.btnSubmit.layer.masksToBounds = YES;定义方向ty.原创 2022-04-21 20:19:31 · 252 阅读 · 0 评论 -
记录TZImagePickerController浏览图片 状态栏 导航栏显示问题
TZImagePickerController与FDFullscreenPopGesture 导致预览图片是导航栏问题原创 2022-03-09 16:07:22 · 1537 阅读 · 1 评论 -
针对整个项目改变font字体大小,设置大中小整体改变功能
使用分类通过runtime使用方法替换功能#import <Foundation/Foundation.h>NS_ASSUME_NONNULL_BEGIN@interface NSObject (Category)/** @brief 方法替换 @param originselector 替换的原方法 @param swizzleSelector 替换后的方法 @param isClassMethod 是否为类方法,YES为类方法,NO为对象方法 */+ (void原创 2021-12-27 14:21:02 · 1762 阅读 · 0 评论 -
iOS蓝牙连接打印机,打印小票
打印小票数据处理,针对服务器返回的数据进行数据封装成modeldataPrint是服务器返回的json数据- (HLPrinter *)getPrinter{ PrinterModel *printModel = [PrinterModel mj_objectWithKeyValues:dataPrint]; HLPrinter *printer = [[HLPrinter alloc] init]; [printer appendTex..原创 2021-12-27 12:17:00 · 2541 阅读 · 1 评论 -
iOS NSDate与NSTimeInterval之间的互转
1、获取当前时间- (NSString *)currentDateStr{ NSDate *currentDate = [NSDate date];//获取当前时间,日期 NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];// 创建一个时间格式化对象 [dateFormatter setDateFormat:@"YYYY/MM/dd hh:mm:ss SS "];//设定时间格式,这里可以设置成自己需原创 2021-04-19 15:30:58 · 1297 阅读 · 0 评论 -
WebView基本操作与js之间调用
今天学习了点WebView 想以后可以复习下所以就记录了下,都是基本的功能;对访问的简单操作- (void)viewDidLoad{ [superviewDidLoad]; [selfloadWebView];}#pragma mark 1 加载远程的html文件- (void)loadWeb原创 2013-08-31 01:29:29 · 945 阅读 · 0 评论 -
数据存储小结,属性列表,archiver 偏好设置,Sqlite3,Core Data
NSString属性列表 把数据存储到沙盒中再从沙盒中取出,明确沙盒目录有两种方式一种 //获取应用沙盒的根路径 NSString *home = NSHomeDirectory(); NSString *documents = [homestringByAppendingPathComponent:@"Documents"];原创 2013-08-31 02:01:45 · 987 阅读 · 0 评论 -
多线程 之 NSThread 简单操作适合初学者
/** run{name = (null), num = 1} num 为1 是主线程 其他就是创建的子线程 使用NSThread 的优缺点 1 优点:NSThread比其他多线程方案较轻量级,更直观地控制线程对象 2 缺点:需要管理线程生命周期,同步加锁问题,会导致一定的性能开销 */- (void)vi原创 2013-08-31 16:03:41 · 810 阅读 · 0 评论 -
多线程之 NSOperation 与 NSOperationQueue 的基本操作 适合基础学习
使用NSOperation 与 NSOperationQueue实现多线程编程 的详解 1 先将需要执行的操作封装到一个NSOperation对象中 2 然后将NSOperation对象添加到NSOperationQueue中 3 系统会自动将NSOperation中封装的操作放到一条新线程中执行此过程你根本不需要考虑生命周期,同步,加锁问题等; N原创 2013-08-31 19:17:02 · 877 阅读 · 0 评论 -
IOS 中最长见之一 Block基础调用数据。
Block 封装了一段代码,可以在任何时候执行, Block 是作为函数阐述或者函数的返回值,而其本身又可以带输入参数或返回值。 Block 是ios4.0开始的那个时候已经很成熟了,苹果公司推荐使用Block Block 需要编译器运行时的堆栈支持,可以作为代理的很好支持 使用方式 与c语言很相似, int (* CFunc) (int a原创 2013-09-01 18:38:51 · 834 阅读 · 0 评论 -
tab bar 与 toolbar使用的区别
tab bar 如新浪微博,ios7系统时钟;显示选中状态,选中后改变图片的背景颜色,比toolbar 高;toolbar如ios7系统的日历, 没有选中状态 有高亮状态 ,原创 2013-10-09 17:55:10 · 1644 阅读 · 0 评论 -
iOS 播放客户端视频
首先导入MediaPlayer框架在导入头文件#import 在.h文件中声明属性 & 事件操作//MPMoviePlayerController 视频@property (strong,nonatomic) MPMoviePlayerController *mpPlay;//按钮的事件处理- (IBAction)pl原创 2013-09-28 01:36:22 · 815 阅读 · 0 评论 -
调用系统完成发短信,打电话,发邮箱,打开浏览器
1、调用 自带mail[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"mailto://xiangxianxiaoxxx@126.com"]]; 2、调用 电话phone[[UIApplication sharedApplication] openURL:[NSURL URLWith转载 2013-09-28 01:50:25 · 1113 阅读 · 0 评论 -
iOS 设置UILabel的背景图片
UIColor *color = [UIColor colorWithPatternImage:[UIImage imageNamed:@"common_card_background_highlighted.png"]]; [self.label setBackgroundColor:color];原创 2013-10-19 14:28:21 · 3593 阅读 · 0 评论 -
UIimage 图片的拉伸
// use resizableImageWithCapInsets: and capInsets.- (UIImage *)stretchableImageWithLeftCapWidth:(NSInteger)leftCapWidth topCapHeight:(NSInteger)topCapHeight; // default is 0. if non-zero, hor原创 2013-11-04 17:01:01 · 982 阅读 · 0 评论 -
使用系统的动画(点击切换界面)
动画的类型// kCATransitionFade 淡化 // kCATransitionPush 推挤 // kCATransitionReveal 揭开 // kCATransitionMoveIn 覆盖 // @“cube” 立方体 // @"suckEffect" 吸收 // @"oglFlip"原创 2013-11-04 17:09:12 · 926 阅读 · 0 评论 -
下拉刷新 & SBJson 的使用
http://www.linuxidc.com/Linux/2013-04/83047.htm 下拉刷新http://blog.csdn.net/jiarusun000/article/details/7712364 SBJson的简单使用转载 2013-11-04 22:36:49 · 799 阅读 · 0 评论 -
SDWebImage的使用
http://blog.csdn.net/wwang196988/article/details/7542885 借鉴http://www.cnblogs.com/wangshengl9263/p/3347933.html 借鉴转载 2013-11-04 22:30:16 · 998 阅读 · 0 评论 -
设置ScrollView的圆角
UIScrollView * scroll = [[UIScrollView alloc]init]; scroll.frame = CGRectMake(5 + 25, 35 + 25, 567, 360); scroll.contentSize = CGSizeMake(567, 360); //是否圆角 scroll.layer.corner原创 2013-11-04 16:56:22 · 3721 阅读 · 0 评论 -
AFNetWorking的基本使用
AFNetwork是一个轻量级的网络请求api类库。是以NSURLConnection,NSOperation和其他方法为基础的。 是最为常用网络请求之一下面这个例子是用来处理json请求的: 案例NSURL *url = [NSURLURLWithString:@"https://alpha-api.app.net/stream/0/posts/stream/global"];N原创 2013-11-04 22:23:56 · 1774 阅读 · 0 评论 -
修改Cell的点击效果(背景 颜色)
//修改cell点击的背景图片 cell.selectedBackgroundView = [[[UIImageView alloc]initWithImage:[[UIImage imageNamed:@"图片"]stretchableImageWithLeftCapWidth:25 topCapHeight:25]] autorelease];//修改Cell的背景颜色原创 2013-11-04 17:32:41 · 2250 阅读 · 0 评论 -
系统请求方式下载图片
在.h文件中写入 需要使用 NSURLConnectionDataDelegate 协议@property (nonatomic, assign) IBOutlet UIImageView *imageView;- (IBAction)download;在.m文件中写入@property (nonatomic, retain) NSMutableData *dat原创 2013-11-06 21:33:15 · 842 阅读 · 0 评论 -
把下载的文件存到指定的文件夹中
在.h 文件中 实现NSURLConnectionDataDelegate协议@property (nonatomic, assign) IBOutlet UIProgressView *progressView;- (IBAction)download;{ // 文件的总长度 int _totalLength;}@property (nonato原创 2013-11-06 21:37:38 · 1500 阅读 · 0 评论 -
异步 同步 文件上传 监听文件上传进度
在.h文件中 使用NSURLConnectionDataDelegate协议在.m文件 #define Data(str) [str dataUsingEncoding:NSUTF8StringEncoding] //宏定义// username// file- (void)viewDidLoad{ [super viewDidLoad];原创 2013-11-06 21:47:47 · 1870 阅读 · 0 评论 -
学习半年来的感受
我也一名初学者 我写的这些东西其实也是为了以后工作时没事就复习下,如果我们都没事就写写博客,把之前我们都不会的记下来 以后我们遇到不会的就可以到网上一搜索就可以收到答案了,,那样我们就不用每天想的焦头烂额了。我也希望能帮到大家 一起相互学习! 因为我们ios是自学的 所以写的也不太好,都是按照我的思路来学习的。我个人觉得每个人必须要有自己的学习方法。那样效率会高点;每个人都有自己的一套学习理念原创 2013-11-06 22:05:48 · 892 阅读 · 0 评论 -
坐标 frame bounds区别 Center 坐标 UIkit坐标
frame 与 bounds centerframe 就是 (x,y width height)40,40, 240,380bounds (wigth height) 240,380 无论怎么设置 x , y 轴都是0center 获取中点 (x, y) 160 , 230x y 轴默认都是零原创 2013-11-07 22:44:07 · 1083 阅读 · 0 评论 -
IOS 集成系统的下拉刷新
.h 文件首先是继承UITableViewController@interface TableViewController ()@property (retain , nonatomic) NSMutableArray * mutableArray;@end.m文件实现内容@implementation TableViewController//第一次下拉显原创 2013-11-09 23:04:00 · 1497 阅读 · 0 评论 -
结构体Rect Point Size 操作
结构体分为 三种模式 CGRect (x, y, width, height); CGPoint(x, y); CGSIze(width, height);//系统写入方式 CGPoint(x, y);struct CGPoint {CGFloat x;CGFloat y;}; CGSIze(width, height)原创 2013-11-07 22:32:33 · 1167 阅读 · 0 评论 -
总结 UIView常用属性 与方法UIButton UIlabel UIControl
控件总结一 UIview 常用属性 1, frame 位置和尺寸(以父控件左上角为原点(0,0)) 2, bounds 位置和尺寸(以自己的左上角为原点(0,0)) 3, center 中心 (以父控件的左上角为原点(0,0)) 4, transform 形变属性 (缩放,旋转) 5,原创 2013-11-07 22:56:35 · 2185 阅读 · 0 评论 -
sbjson框架使用 jsonDemo1 json操作 请求,下载,转码
首先需要导入SBJson框架 在导入头文件 在进行操作#import "SBJson.h"@implementation ViewController- (void)viewDidLoad{ [super viewDidLoad]; //XML JSON 描述性语言 //甄嬛传 大清后宫。。。 99$ //原创 2013-11-09 22:45:40 · 1246 阅读 · 0 评论 -
SBJson 框架使用2 SBJson解析数据 解析字典,数组
先导入SBJSON框架 导入sbjson 头文件 #import "SBJson.h"@implementation ViewController- (void)viewDidLoad{ [super viewDidLoad]; dataArray = [[NSMutableArray alloc] init]; NSStrin原创 2013-11-09 22:49:53 · 1186 阅读 · 0 评论 -
4个方向的手势 操作
- (void)handleSwipe:(UISwipeGestureRecognizer *)gesture { UISwipeGestureRecognizerDirection direction = gesture.direction; switch (direction) { case UISwipeGestureRecognizerDirectionLe原创 2014-02-21 15:51:52 · 969 阅读 · 0 评论 -
获取设备信息
//手机序列号 NSString* identifierNumber = [[UIDevice currentDevice] uniqueIdentifier]; NSLog(@"手机序列号: %@",identifierNumber); //手机别名: 用户定义的名称 NSString* userPhoneName = [[UIDevice current原创 2014-02-21 16:19:35 · 933 阅读 · 0 评论 -
限制textView的长度 对textView 的输入个数进行判断
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text{ /* if ([text isEqualToString:@"\n"]) { [textView resignFirstRespo...原创 2014-02-21 15:21:37 · 1036 阅读 · 0 评论 -
对字符串(手机号)转换为前3 后3 中4*
- (NSString *)formatPhone4n4{ NSInteger len = self.length; if (len < 7) { return self; } NSRange range = NSMakeRange(3, len - 7); NSMutableString *points = [[NSMutableStri原创 2014-02-21 15:48:01 · 1002 阅读 · 0 评论 -
非arc 转 arc 使用程序
1,选择项目中的Targets,选中你所要操作的Target,2,选Build Phases,在其中Complie Sources中选择需要ARC的文件双击, 并在输入框中输入:-fobjc-arc,如果不要ARC则输入:-fno-objc-arc转载 2014-03-04 09:42:40 · 785 阅读 · 0 评论 -
URL Scheme 统计
QQ mqq:// 微信 weixin:// 淘宝 taobao:// 点评 dianping:// dianping://search 微博 sinaweibo:// 支付宝 alipay:// 豆瓣fm doubanradio:// 微盘 sinavdisk:// 美团 imeituan:// 人人 renren:// 我查查 wcc:// 1号店 wccbyi原创 2014-03-14 17:13:13 · 2443 阅读 · 0 评论 -
使用AFNetworking 报错提示
数据请求失败Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)" (JSON text did not start with array or object and option to allow fragments not set.) UserI原创 2014-04-09 16:15:30 · 34505 阅读 · 1 评论 -
如何创建静态库 与 使用静态库联调、制作静态库加载不上图片的问题
如何制作静态库 在此博文已经写的很好了http://www.cnblogs.com/superhappy/archive/2013/05/27/3102629.html如何进行联调那?由于本人不会使用 博文中得 截图 所以用语言概述下把 在能显示UI的工程(也就是.app 的工程)中加入 静态库的工程(也就是.a 的工程) 在 "Products"这个文件下面加入 静态库的工程。原创 2014-03-20 12:04:06 · 1146 阅读 · 0 评论 -
Objective-c 语法之集合NSDictionary & NSSet & NSArray
1、不可变词典 NSDictionary 的主要用法[ NSDictionary dictionaryWithobjec]转载 2014-05-03 00:33:19 · 1135 阅读 · 0 评论