第19月第20天uitableview:改变tableheaderview的高度(代码片段)

lianhuaren lianhuaren     2022-11-04     743

关键词:

1.UITableView:改变 TableHeaderView 的高度

CGRect newFrame = headerView.frame;
newFrame.size.height = newFrame.size.height + webView.frame.size.height;
headerView.frame = newFrame;
[self.tableView setTableHeaderView:headerView];

 

http://www.cnblogs.com/ihojin/p/tableHeaderView-resizeheight.html

 

2.

static long long fileSizeAtPath(NSString *filePath) 
    struct stat st;
    
    //获取文件的一些信息,返回0的话代表执行成功
    if(lstat([filePath cStringUsingEncoding:NSUTF8StringEncoding], &st) == 0)
        
        //返回这个路径下文件的总大小
        return st.st_size;
    
    return 0;



static long long folderSizeAtDirectory(NSString *folderPath) 
    NSFileManager* manager = [NSFileManager defaultManager];
    if (![manager fileExistsAtPath:folderPath]) 
        return 0;
    
    NSEnumerator *childFilesEnumerator = [[manager subpathsAtPath:folderPath] objectEnumerator];
    NSString* fileName;
    long long folderSize = 0;
    while ((fileName = [childFilesEnumerator nextObject]) != nil) 
        NSString* fileAbsolutePath = [folderPath stringByAppendingPathComponent:fileName];
        folderSize += fileSizeAtPath(fileAbsolutePath);
    
    return folderSize;

 

 https://github.com/HCat/trafficPolice

 

第26月第20天springboot

1.1、pom.xml中添加支持web的模块:<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency>pom.xml文件中默认有两个模块:spring- 查看详情

第20月第29天cocoa抽象工厂(代码片段)

1.在CocoaTouch框架中,类簇是抽象工厂模式在iOS下的一种实现,以NSArray举例,将原有的alloc+init拆开写:idobj1=[NSArrayalloc];//__NSPlacehodlerArray*idobj2=[NSMutableArrayalloc];//__NSPlacehodlerArray*idobj3=[obj1init];//__NSArrayI*idobj4 查看详情

第12月第2天uiscrollview_adjustcontentoffsetifnecessary

1.uiscrollview在调用setFrame,setBounds等方法的时候会默认调用稀有api:_adjustContentOffsetIfNecessary这个方法会改变当前的contentOffset值 如果没有设置 self.automaticallyAdjustsScrollViewInsets=NO;那么(CGPoint)contentOffset=(x=0, 查看详情

第9月第3天uilabelcontentscale

1. http://blog.csdn.net/u012703795/article/details/43706449 查看详情

第9月第30天mvp

1. importUIKitstructPerson{//ModelletfirstName:StringletlastName:String}protocolGreetingView:class{funcsetGreeting(greeting:String)}protocolGreetingViewPresenter{init(view:GreetingView,person:Per 查看详情

第16月第27天pipinstallvirtualenv

1.pipinstallvirtualenvvirtualenvtestvircdtestvircdScriptsactivatepipinstalldjango==1.9.8 https://zhuanlan.zhihu.com/p/32286726 查看详情

第2月第24天coretext行高

1.NSMutableAttributedString 行高 NSMutableAttributedString*attributedString=[[NSMutableAttributedStringalloc]initWithString:labelText];NSMutableParagraphStyle*paragraphStyle=[[NSMutableParagra 查看详情

第10月第28天touchesbegan

1.-(void)touchesBegan:(NSSet*)toucheswithEvent:(UIEvent*)event{[[selfnextResponder]touchesBegan:toucheswithEvent:event];[supertouchesBegan:toucheswithEvent:event];}-(void)touchesMoved:(NSSet*)touchesw 查看详情

第37月第29天avplayer截屏

1.-(void)displayLinkCallback:(CADisplayLink*)sender{CMTimetime=[snapshotOutputitemTimeForHostTime:CACurrentMediaTime()];if([snapshotOutputhasNewPixelBufferForItemTime:time]){lastSnapshotPixelBuffer=[s 查看详情

第5月第18天视频编辑水印

1.//***********ForASpecialTimeCABasicAnimation*animation=[CABasicAnimationanimationWithKeyPath:@"opacity"];[animationsetDuration:0];[animationsetFromValue:[NSNumbernumberWithFloat:1.0]];[animationsetT 查看详情

第16月第3天afurlsessionmanager

1. -(AFURLSessionManagerTaskDelegate*)delegateForTask:(NSURLSessionTask*)task{  NSParameterAssert(task);   AFURLSessionManagerTaskDelegate*delegate=nil;  [self. 查看详情

第25月第11天deeplearning.ai

1.网易云课堂深度学习工程师点击进入课程地址(英文)(收费)点击进入课程地址(中文)(免费)第一门神经网络和深度学习第二门改善神经网络第三门结构化机器学习项目第四门卷积神经网络第五门序列模型  查看详情

第11月第14天openglyuv

1.Hereissomesnippetsofcodefrommyproject‘movieplayerforiOS‘.1.fragmentshadervaryinghighpvec2v_texcoord;uniformsampler2Ds_texture_y;uniformsampler2Ds_texture_u;uniformsampler2Ds_texture_v;voidmain(){hig 查看详情

第26月第3天javagradle

1.430/Applications/AndroidStudio.app/Contents/gradle/gradle-2.8/bin/gradle-v434mkdirgradle01435cdgradle01 437 /Applications/AndroidStudio.app/Contents/gradle/gradle-2.8/bin/gradleinit--typ 查看详情

第5月第6天nsoperationisconcurrent

1. @implementationAFURLConnectionOperation...-(BOOL)isConcurrent{returnYES;} NSOperation调用start方法即可开始执行操作,NSOperation对象默认按同步方式执行,也就是在调用start方法的那个线程中直接执行。NSOperation对象的isConcurrent方法会告诉我... 查看详情

第9月第5天avvideoaveragebitratekey

1.https://stackoverflow.com/questions/11751883/how-can-i-reduce-the-file-size-of-a-video-created-with-uiimagepickercontroller http://www.jianshu.com/p/61a9030adeef 查看详情

第16月第10天pocotarget

 1.voidTCPServer::start(){  poco_assert(_stopped);   _stopped=false;  _thread.start(*this);} voidThread::start(Runnable&target){startImpl(target);}...v 查看详情

第32月第12天blockstop(代码片段)

1.-(NSMutableArray*)filterUsingBlock:(BOOL(^)(idobj,NSUIntegeridx,BOOL*stop))blockif(!block)return[selfmutableCopy];NSMutableArray*result=[NSMutableArrayarray];NSUIntegeridx=0;BOOLstop=NO;for(idobj 查看详情