zoukankan      html  css  js  c++  java
  • 五一结束,北戴河,yy,差一点,不太敢

    collectionView Cell 设置颜色,蓝色,但是其他cell颜色也蓝色了,因为只写了if 没写else

        if (indexPath.item == 0) {

            cell.backgroundColor = kEssentialColor;

        }else {

            cell.backgroundColor = kG6Color;

        }

     

     

    1、获取string的宽度

    -(float) (NSString *)text{

       CGSize size=[text sizeWithFont:[UIFont systemFontOfSize:15]constrainedToSize:CGSizeMake(MAXFLOAT,36)];

       //text是想要计算的字符串,15是字体的大小,36是字符串的高度(根据需求自己改变)

        return size.width;

    }

     

    collectionViewCell 间距不对

    - (NSArray *) layoutAttributesForElementsInRect:(CGRect)rect {
        NSArray *answer = [super layoutAttributesForElementsInRect:rect];

    for(int i = 1; i <  [answer count]; ++i) {
            UICollectionViewLayoutAttributes *currentLayoutAttributes = answer[i];
            UICollectionViewLayoutAttributes *prevLayoutAttributes = answer[i - 1];
            NSInteger maximumSpacing = 4;
            NSInteger origin = CGRectGetMaxX(prevLayoutAttributes.frame);
            if(origin + maximumSpacing + currentLayoutAttributes.frame.size.width <  self.collectionViewContentSize.width) {
                CGRect frame = currentLayoutAttributes.frame;
                frame.origin.x = origin + maximumSpacing;
                currentLayoutAttributes.frame = frame;
            }
        }
        return answer;
    }
    -------

    一个接口高了一下午,定位,直接用小崔给的代码就行了 参数,省份,城市参数

     

     

    ---------

    /**

     *  去掉"市"

     *

     *  @param string 待验证的字符串

     *

     *  @return 不带"市"的字符串

     */

    -(NSString *)removeShi:(NSString *)string {

        if ([string hasSuffix:@"市"]) {

            return [string componentsSeparatedByString:@"市"][0];

        }else {

            return string;

        }

    }

    计算机生成了可选文字:
Find Text Containing 
Q- CHDFSpeciaIComeDataHeIper outpa 
Ńi*matchinq containing 
m HDFHospitaITabIeViewControIIer.m ne

     

    --------------------------------------------------

    iOS6被废弃的方法,判断后使用

    ------------------------------------

    隐藏出诊地点,--根据数据来变的,给个假数据

    ------------------------------

    数组不能调用removeObjAtIndex方法

    可变数组才能调用removeObjAtIndex方法

    ------------------------------------

    这个请求写的太繁琐

    - (void)requestSpecialistComingInfor:(NSString *)lbsProvince lbsCity:(NSString *)lbsCity province:(NSString *)province city:(NSString *)city {

    ------------------------------------------------------------

        NSMutableArray *tempOriginFacultyArray = self.originFacultyArray.copy; //删除崩溃

    mutableCopy不崩溃  

        [temp delete:model]; .// 不是数组的方法,会崩溃

  • 相关阅读:
    基于opencv的摄像头的标定
    图像的角点简介
    周转时间和平均带权时间等
    QT各个版本的下载的地址
    参考文献格式
    sublime中的emmet插件的使用技巧
    sublime快捷键
    CSS布局居中
    Markdown 语法说明(简体中文版)
    sql作业题
  • 原文地址:https://www.cnblogs.com/tufei7/p/5454118.html
Copyright © 2011-2022 走看看