控制器里,是本人的首先篇作品

那是一篇约等于,小编付出进度中的一篇笔记吧。只怕比较混乱,是本身的首先篇小说。

1.改变cell的imageView的大小

1.应用三方地图软件的时候:地图功用展现网格

并发那个的原委,恐怕是您的地图apikey有标题,

UIImage *icon = [UIImage
imageNamed:@”pic_poi_detail_pop_call”];

2. button 文字对其

Button.contentHorizontalAlignment =
UIControlContentHorizontalAlignmentLeft;//左对齐(UIControlContentHorizontalAlignment、CenterUIControlContentHorizontalAlignmentFill、UIControlContentHorizontalAlignmentRight)

Button.contentVerticalAlignment =
UIControlContentVerticalAlignmentBottom;//底部对其(UIControlContentVerticalAlignmentCenter、UIControlContentVertical阿里gnmentFill、UIControlContentVerticalAlignmentTop)


3安装button 上海图书馆片,文字的职位

button.image艾德geInsets =
UI艾德geInsetsMake(5,13,21,button.titleLabel.bounds.size.width);//设置image在button上的地方(上top,左left,下bottom,右right)那里能够写负值,对上写-5,那么image就象上移动多少个像素

button.title艾德geInsets = UI艾德geInsetsMake(71,
-button.titleLabel.bounds.size.width-50, 0,
0);//设置title在button上的地方(上top,左left,下bottom,右right)

CGSize itemSize = CGSizeMake(17, 21);

4.向上取整 ceilf()

UIGraphicsBeginImageContextWithOptions(itemSize, NO,0.0);

5断点续传首要方法

/ /. 操作

AFHTTPRequestOperation *op = [[AFHTTPRequestOperation alloc]
initWithRequest:request];

_downloadOperation = op;

// 下载

// 内定文件保留路径,将文件保留在沙盒中

NSArray docs = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES);

NSString path = [docs[0]
stringByAppendingPathComponent:@“download.zip”];

op.outputStream = [NSOutputStream outputStreamToFileAtPath:path
append:NO];

// 设置下载进度代码块

bytesRead 当前率先次读取的字节数(100k)

totalBytesRead 已经下载的字节数(4.9M)

totalBytesExpectedToRead 文件总大小(5M)

[op setDownloadProgressBlock:^(NSUInteger bytesRead, long long
totalBytesRead, long long totalBytesExpectedToRead) {

// 设置进程条百分比

CGFloat precent = (CGFloat)totalBytesRead / totalBytesExpectedToRead;

NSLog(@”%f”, precent);

_progressView.progress = precent;

}];

CGRect imageRect = CGRectMake(0.0, 0.0, itemSize.width,
itemSize.height);

6//主动退出程序

– (void)exitApplication {

[UIView beginAnimations:@”exitApplication” context:nil];

[UIView setAnimationDuration:0.5];

[UIView setAnimationDelegate:self];

// [UIView setAnimationTransition:UIViewAnimationCurveEaseOut
forView:self.view.window cache:NO];

[UIView setAnimationTransition:UIViewAnimationCurveEaseOut
forView:self.window cache:NO];

[UIView
setAnimationDidStopSelector:@selector(animationFinished:finished:context:)];

//self.view.window.bounds = CGRectMake(0, 0, 0, 0);

self.window.bounds = CGRectMake(0, 0, 0, 0);

[UIView commitAnimations];

}

– (void)animationFinished:(NSString *)animationID finished:(NSNumber
*)finished context:(void *)context {

if ([animationID compare:@”exitApplication”] == 0) {

exit(0);

}

}

[icon drawInRect:imageRect];

8安装tableViewCell间的分割线的颜料

[theTableView setSeparatorColor:[UIColor xxxx ]];

cell.imageView.contentMode=UIViewContentModeScaleAspectFit;

9.SDWebImage 清除图片缓存

指定的

[[SDImageCache sharedImageCache] removeImageForKey:url];

[[SDImageCache sharedImageCache] removeImageForKey:url
fromDisk:YES];

全部

[[SDImageCache sharedImageCache] clearDisk];

[[SDImageCache sharedImageCache] clearMemory];

忽视缓存,每便都平昔下载格局

   UIImage *selectImage = [UIImage imageNamed:[NSString
stringWithFormat:@”bottom_profile_active”]];

    self.tabBarController.tabBar.selectedItem.selectedImage  =
[selectImage
imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

cell.imageView.image = UIGraphicsGetImageFromCurrentImageContext();

10.tableView正在滚动结束滚动

CGPoint offset = self.tableView.contentOffset;

(self.tableView.contentOffset.y > 0) ? offset.y– : offset.y++;

[self.tableView setContentOffset:offset animated:NO];

其它://在willDisplayCell里面处理数量能优化tableview的滑行流畅性

//获取具有cell 的方式

NSArray*array = [self.tableView visibleCells]; 

UIGraphicsEndImageContext();

11.修改tabbar

设置文字颜色

[self.navigationController.navigationBar
setTitleTextAttributes:[NSDictionary
dictionaryWithObjectsAndKeys:[UIColor blackColor],

安装位子字体

NSForegroundColorAttributeName, [UIFont systemFontOfSize:18],
NSFontAttributeName, nil]];

取到对应nav

UIViewController *vc2 = self.tabBarController.viewControllers[2];

安装对应图片

UIImage * homenormalImage = [[UIImage imageNamed:@”bottom_tv_bg”] 
imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

UIImage * homeselectImage = [[UIImage imageNamed:@”bottom_tv_bg”] 
imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

vc2.tabBarItem=[[UITabBarItem alloc]initWithTitle:@””
image:homenormalImage selectedImage:homeselectImage];

设置文字地点

[self.navigationController.tabBarItem
setTitlePositionAdjustment:UIOffsetMake(0, -5)];

设置图片地点

self.navigationController.tabBarItem.imageInsets =
UIEdgeInsetsMake(-2.5, 0, 2.5, 0);

2.安装cell的分割线从零开始

12.GCD并列请求:

dispatch_group_t serviceGroup = dispatch_group_create();

// Start the first service

dispatch_group_enter(serviceGroup);

[self.configService startWithCompletion:^(ConfigResponse *results,
NSError* error){

// Do something with the results

configError = error;

dispatch_group_leave(serviceGroup);

}];

// Start the second service

dispatch_group_enter(serviceGroup);

[self.preferenceService startWithCompletion:^(PreferenceResponse
*results, NSError* error){

// Do something with the results

preferenceError = error;

dispatch_group_leave(serviceGroup);

}];

dispatch_group_notify(serviceGroup,dispatch_get_main_queue(),^{

// Assess any errors

NSError *overallError = nil;

if (configError || preferenceError)

{

// Either make a new error or assign one of them to the overall error

overallError = configError ?: preferenceError;

}

// Now call the final completion block

completion(overallError);

});

-(void)layoutSubviews{

13.防止 timer  阻塞

[[NSRunLoop currentRunLoop] addTimer:_animationTimer
forMode:UITrackingRunLoopMode];

if ([self.nearDetailTableview
respondsToSelector:@selector(setSeparatorInset:)]) {

14.masonry  等分控件

/**

*  多少个控件固定间隔的等间隔排列,变化的是控件的尺寸恐怕增长幅度值

*

*  @param axisType        轴线方向

*  @param fixedSpacing    间隔大小

*  @param leadSpacing    尾部间隔

*  @param tailSpacing    尾部间隔

*/

– (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType

withFixedSpacing:(CGFloat)fixedSpacing l

eadSpacing:(CGFloat)leadSpacing

tailSpacing:(CGFloat)tailSpacing;

/**

*  三个固定大小的控件的等间隔排列,变化的是距离的当儿

*

*  @param axisType        轴线方向

*  @param fixedItemLength 各类控件的固定长度或许增长幅度值

*  @param leadSpacing    底部间隔

*  @param tailSpacing    尾部间隔

*/

– (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType

withFixedItemLength:(CGFloat)fixedItemLength

leadSpacing:(CGFloat)leadSpacing

tailSpacing:(CGFloat)tailSpacing;


[self.nearDetailTableview setSeparatorInset:UIEdgeInsetsZero];

15.数码遍历快捷,高效方法

//enumerateObjectsUsingBlock 类似于for,但是比for更快

[array enumerateObjectsUsingBlock:^(MyCell * _Nonnull obj, NSUInteger
idx, BOOL * _Nonnull stop) {

[obj cellOffset];

}];


}

16.runtime 还是性质

// 获取对象里的性质列表

objc_property_t * properties = class_copyPropertyList([instance

class], &outCount);

for (i = 0; i < outCount; i++) {

objc_property_t property =properties[i];

//  属性名转成字符串

NSString *propertyName = [[NSString alloc]
initWithCString:property_getName(property)
encoding:NSUTF8StringEncoding];

// 判断该属性是或不是留存

if ([propertyName isEqualToString:verifyPropertyName]) {

free(properties);

return YES;

}

}

free(properties);


if ([self.nearDetailTableview
respondsToSelector:@selector(setLayoutMargins:)])  {

17.哪些得到app  网页JS代码  command+,  进入偏好设置,  高级打开菜单栏,然后safafi 开发-simulate-选择你想要的。

[self.nearDetailTableview setLayoutMargins:UIEdgeInsetsZero];

18.部分干货推荐

}

(1)图片大全

http://findicons.com/

http://www.easyicon.net/

}

(2)大牛blog

博客地址 路虎极光SS地址

OneV’s Den http://onevcat.com/atom.xml

破船之家 http://beyondvincent.com/atom.xml

NSHipster http://nshipster.cn/feed.xml

Limboy 无网不剩 http://feeds.feedburner.com/lzyy

唐巧的技能博客 http://blog.devtang.com/atom.xml

Lex Tang http://lexrus.com/feed.xml

念茜的博客 http://nianxi.net/feed.xml

Xcode Dev http://blog.xcodev.com/atom.xml

Ted’s Homepage http://wufawei.com/feed

txx’s blog http://blog.t-xx.me/atom.xml

Kevin Blog http://zhowkev.in/rss

阿毛的蛋疼地 http://www.xiangwangfeng.com/atom.xml

亚庆的 Blog http://billwang1990.github.io/atom.xml

Nonomori http://nonomori.farbox.com/feed

犯颜直谏 http://tang3w.com/atom.xml

Wonderffee’s Blog http://wonderffee.github.io/atom.xml

I’m TualatriX http://imtx.me/feed/latest/

Cocoabit http://blog.cocoabit.com/atom.xml

nixzhu on scriptogr.am http://nixzhu.me/feed

不会开机的男孩 http://studentdeng.github.io/atom.xml

Nico http://blog.inico.me/atom.xml

阿峰的技能窝窝 http://hufeng825.github.io/atom.xml

answer_huang http://answerhuang.duapp.com/index.php/feed/

webfrogs http://blog.nswebfrog.com/feed/

代码手工业歌唱家 http://joeyio.com/atom.xml

Lancy’s Blog http://gracelancy.com/atom.xml

I’m Allen http://www.imallen.com/atom.xml

Travis’ Blog http://imi.im/feed

王中周的技术博客 http://wangzz.github.io/atom.xml

会写代码的猪 http://gaosboy.com/feed/atom/

克伟的博客 http://feed.cnblogs.com/blog/u/23857/rss

摇滚作家 http://feed.cnblogs.com/blog/u/35410/rss

Luke’s Homepage http://geeklu.com/feed/

萧宸宇 http://iiiyu.com/atom.xml

Yuan博客 http://www.heyuan110.com/?feed=rss2

Shining IO http://shiningio.com/atom.xml

YIFEIYANG–易飞扬的博客 http://www.yifeiyang.net/feed

KooFrank’s Blog http://koofrank.com/rss

hello it works http://helloitworks.com/feed

码农人生 http://msching.github.io/atom.xml

玉令天下的Blog http://yulingtianxia.com/atom.xml

不掏蜂窝的熊 http://www.hotobear.com/?feed=rss2

猫·仁波切 https://andelf.github.io/atom.xml

煲仔饭 http://ivoryxiong.org/feed.xml

里脊串的开发小说 http://adad184.com/atom.xml

Chun Tips http://chun.tips/atom.xml

Why’s blog – 汪海的实验室 http://blog.callmewhy.com/atom.xml

Kenshin Cui’s Blog http://www.cnblogs.com/kenshincui/rss

技术哥的博客 http://suenblog.duapp.com/rss/

控制器里

(3)很多大好的第②方库

http://blog.csdn.net/yipanbo/article/details/40047735

-(void)viewDidLayoutSubviews{

(4)swift 学习

http://wiki.jikexueyuan.com/project/swift/

http://www.ioscookies.com  三方插件

if ([self.recommendTableView
respondsToSelector:@selector(setSeparatorInset:)]) {

19 tableViewCell  

[self.recommendTableView setSeparatorInset:UIEdgeInsetsZero];

UITableViewCell分割线右侧部分缺点和失误一些的缓解方法

-(void)viewDidLayoutSubviews {

if ([self.mytableview
respondsToSelector:@selector(setSeparatorInset:)]) {

[self.mytableview setSeparatorInset:UIEdgeInsetsZero];

}

if ([self.mytableview
respondsToSelector:@selector(setLayoutMargins:)])  {

[self.mytableview setLayoutMargins:UIEdgeInsetsZero];

}

}

-(void)tableView:(UITableView *)tableView
willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath
*)indexPat{

if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {

[cell setLayoutMargins:UIEdgeInsetsZero];

}

if ([cell respondsToSelector:@selector(setSeparatorInset:)]){

[cell setSeparatorInset:UIEdgeInsetsZero];

}

}


}

20 UIButton怎么着去掉高亮透明效果

– (void)setHighlighted:(BOOL)highlighted{

}

self.btn_loginNow.adjustsImageWhenDisabled = NO;

self.btn_loginNow.adjustsImageWhenHighlighted = NO;

if ([self.recommendTableView
respondsToSelector:@selector(setLayoutMargins:)])  {

[self.recommendTableView setLayoutMargins:UIEdgeInsetsZero];

}

}

-(void)tableView:(UITableView *)tableView
willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath
*)indexPat{

if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {

[cell setLayoutMargins:UIEdgeInsetsZero];

}

if ([cell respondsToSelector:@selector(setSeparatorInset:)]){

[cell setSeparatorInset:UIEdgeInsetsZero];

}

}

相关文章