城觅知识点

来源:互联网 发布:excel对应数据替换 编辑:程序博客网 时间:2024/04/28 20:50
1.//清空interactivePopGestureRecognizer的delegate可以恢复因替换导航条的back按钮失去系统默认手势    self.interactivePopGestureRecognizer.delegate = nil;    //禁止手势冲突    self.interactivePopGestureRecognizer.enabled = NO;
2.//去掉导航条的半透明    bar.translucent = NO;
3.设置NavigationBar的主题: NSMutableDictionary *dict = [NSMutableDictionary dictionary];    dict[NSFontAttributeName] = [UIFont systemFontOfSize:20];    dict[NSForegroundColorAttributeName] = [UIColor whiteColor];    [bar setTitleTextAttributes:dict];
4.当前导航控制器的栈顶控制器(也就是显示出来的控制器):self.topViewController    当这个导航控制器push了很多控制器后:[self.viewControllers firstObject]是根导航控制器    判断两者是否相同即可判断手势是否可用,是否可以侧滑之类
以后如果封装一个东西的话,不一定里面的内容仅仅是自己,可以根据需要传递有关的控件,然后利用这个控件的一系列内容封装自己。。。例如城觅中的cityButton
把一个View添加进来不一定是addSubView,有insert.....所以思想不要太禁锢一个view的显示隐藏啊,都是自己的事情,应该封装到自己的方法里,只是给出方法调用,让别人调用方法来控制,而不是说让别人addSubView,remove之类的,要有封装的思想
在设置UICollectionViewFlowLayout的时候,有四点可以通过flowlayout设置,layout.itemSize//每行内部cell item的间距layout.minimumInteritemSpacinglayout.minimumLineSpacinglayout.sectionInset = UIEdgeInsetsMake();
//用来拦截事件。。。。。。。- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event{    /*  拦截事件响应者,不论触发了cell中的哪个控件都交给iconButton来响应 */    // 1.判断当前控件能否接收事件    if (self.userInteractionEnabled == NO || self.hidden == YES || self.alpha <= 0.01) return nil;    // 2. 判断点在不在当前控件    if ([self pointInside:point withEvent:event] == NO) return nil;    return self.iconButton;}
//一般用来设置阴影,并设置阴影的偏移量self.layer.shadowOpacity = 0.1;    self.layer.shadowOffset = CGSizeMake(0, 2);
0 0
原创粉丝点击