杂货铺

2018-03-15  本文已影响0人  真的很菜

1、自己导入文件到项目后使用报错 'NSInvalidArgumentException', reason: '*** -[NSURL initFileURLWithPath:]: nil string parameter'   找不到文件

2、 点击电池条scrollView会滚动到顶部,解决方法tableView.scrollsToTop = NO

3、关于里添加appstore评分入口 参照微博 [[UIApplicationsharedApplication]openURL:[NSURLURLWithString:@"http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=APPID&pageNumber=0&sortOrdering=2&type=Purple+Software&mt=8"]];(APPID可在itunce里面查到)

4、ios 11 tableView Group下 直接通过代理设置header和footer高度没效果 必须要实现- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {    return nil;}

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {    return nil;} 两代理方法

5、没有navi情况下tableView下移,解决方法:

if ([self respondsToSelector:@selector(setContentInsetAdjustmentBehavior:)]) {

        if (@available(iOS 11.0, *)) {

            self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;

        } else {

       // Fallback on earlier versions

        }

    }

6、iOS 自带悬浮调试框,参考http://swift.gg/2017/05/27/ui-debugging-information-overlay/#more

7 关于启动页

一. 用 LaunchScreen.storyboard方式添加启动页1,跑一下程序,App启动页为1,然后更换启动页为2

    1.启动页更换为LaunchImage方式,跑一下程序,app启动页为1.不成功

    2.启动页更换为LaunchImage和 LaunchScreen.storyboard,跑一下程序,黑屏。不成功

    3.直接更换 LaunchScreen.storyboard的图片,跑一下程序,app启动页为2.成功

二.用 LaunchScreen.xib方式添加启动页1,跑一下程序,App启动页为1,然后更换启动页为2

    1.启动页添加方式更换为LaunchImage方式,跑一下程序,app启动启动页为1。不成功

    2.启动页添加方式不更换,跑一下程序,app启动页为1。不成功

    3..启动页更换LaunchScreen.storyboard,跑一下程序,app启动页为2。成功

三.用LaunchImage方式添加启动页1,跑一下程序,app启动页为1,然后更换启动页为2

    1.启动页添加方式不变,跑一下程序,app启动页为2。成功

    2.启动页添加方式换为LaunchScreen.xib,跑一下程序,app启动页为2。成功

    3.启动页添加方式换为LaunchScreen.storyboard,跑一下程序,app启动页为2。成功

8、 关于URL Scheme(广告、活动、推广用的较多)

9、label设置attributedText后,超出宽度部分不会用省略号(...)而是直接将文字截断下图:  

文字切掉

设置label的_actorsLabel.lineBreakMode = NSLineBreakByTruncatingTail(结尾部分的内容 以……方式省略)即可显示省略号:

省略号

10、xcode。rename failed

Go to ~/Library/Developer/Xcode/DerivedData and remove folder contents including "ModuleCache".

上一篇 下一篇

猜你喜欢

热点阅读