Giter VIP home page Giter VIP logo

ios-notes's Introduction

UITableView 相关资料

  • 一句代码解决UITableView 中的分割线顶格问题
self.tableView.separatorInset = UIEdgeInsetsZero;

cocoapods 创建Podfile

  • cd 项目路径/
  • touch Podfile
  • vim Podfile
inhibit_all_warnings!
platform:ios,'8.0'
use_frameworks!

target "项目名称" do
pod 'MJExtension'
end
  • esc,:wq 保存退出
  • pod install

使用Xib AutoLayout布局控件设置规定尺寸但显示效果不是自己想要的,加入以下属性

self.autoresizingMask = UIViewAutoresizingNone;

隐藏Group TableView上边多余的间隔

  • 这个间隔其实是一个被 UITableView 默认填充的 HeaderView。而且,视图的高度不能为0,否则完全不起效果。但我们用下面的代码创建一个高度特别小的 HeaderView 时,上面的边距就不见了
self.tableView.tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, CGFLOAT_MIN)];

跳转到苹果商店下载页面/评论页面

  • 跳转到苹果商店下载页面
NSString *str = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/app/id%d", app_id];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
  • 跳转到苹果商店评论页面
NSString *str = [NSString stringWithFormat:@"http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=%d&pageNumber=0&sortOrdering=2&type=Purple+Software&mt=8",app_id];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];

在一个自定义的View中,或者自定义cell中,modal出一个控制器建议使用

[UIApplication sharedApplication].keyWindow.rootViewController;

代替

self.window.rootViewController

因为程序可能不止一个window,self.window可能不是主窗口;


ios-notes's People

Contributors

sandouchen avatar sandouchan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.