【整理】swift开发心得+跳过的坑
crifan 9年前 (2015-11-12) 2095浏览 0评论
跳过的坑 layoutSubviews中尽量不要添加subview 否则: 每次页面重新布局显示 (不如进入子页面后再返回当前页面,此时也会调用layoutSubviews的) 此时导致的是: add的subview,会被多次添加 比如: 我之前在...
crifan 9年前 (2015-11-12) 2095浏览 0评论
跳过的坑 layoutSubviews中尽量不要添加subview 否则: 每次页面重新布局显示 (不如进入子页面后再返回当前页面,此时也会调用layoutSubviews的) 此时导致的是: add的subview,会被多次添加 比如: 我之前在...
crifan 9年前 (2015-11-12) 6418浏览 0评论
可以通过: UIEdgeInsetsInsetRect 去调整一个frame的尺寸 代码: let originRect = CGRectMake(0, 0, 200, 400) let demoView = UIView(frame: origi...
crifan 9年前 (2015-11-12) 2225浏览 0评论
参见官网的解释: UIApplicationMain(_:_:_:_:) – UIKit Function Reference UIGraphicsGetCurrentContext() UIGraphicsPushContext(_...
crifan 9年前 (2015-11-12) 2729浏览 0评论
想要实现,页面跳转,基于导航栏的去跳转。 搜: swift navigation view 参考: Start Developing iOS Apps (Swift): Implement Navigation 搜: sw...
crifan 9年前 (2015-11-11) 2948浏览 0评论
想要设置tab的背景色: 相关已有代码为: //6. create tabs let viewConversation = ConversationViewController() let...
crifan 9年前 (2015-11-11) 4360浏览 0评论
如图: UITableViewCell的text和detailText的垂直距离非常小,希望: 让text和detailText都垂直居中,上下的距离大一些 增加textLabel和detailTextLabel的垂直方向的距离 [解决过程] ...
crifan 9年前 (2015-11-10) 2983浏览 0评论
希望实现 把一个视图,从父视图中移除掉 类似于: removeSubviews 最后经过找寻,发现是removeFromSuperview: 比如: cell.detailTextLabel?.subviews[0].removeFromSu...
crifan 9年前 (2015-11-09) 3201浏览 0评论
UITableViewCell中: cell.detailTextLabel?.textColor = ColorConversationDetailText cell.detailTextLabel?.font = ...
crifan 9年前 (2015-11-09) 1852浏览 0评论
之前折腾过iOS的UITableView 现在整理一点,相关的资料。 UITableView的布局和元素 UIKit User Interface Catalog: Table Views A Closer Look at Ta...
crifan 9年前 (2015-11-09) 4317浏览 0评论
swift中,想要初始化一个指定个数的某个类型的数组,比如: var uniqueRandomArr:[Int] = [Int](arrCount) 根据代码提示: Missing argument label arrayLiterral in c...