解决ios(cp)4.3问题

本文章一直更新,主要针对解决ios上包问题中出现的4.3给与针对性的解决方案。

主要解决方式:在应用程序中加入垃圾代码。

1、写入垃圾代码块,2、在方法中调用此垃圾代码。3、在每个.m文件中加入即可防止4.3出现。

备注:只要在每个.m文件中引用其中一个代码模块就可以了

2、调用方法的时候,函数名称一定一定要改!

===============================================

代码模块一:

调用方式:

[self addClassCollectionView];

主要代码:

- (void)addClassCollectionView {

    UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];

    layout.itemSize = CGSizeMake(ScreenWidth * 0.5 , 60*PRHEIGHT);

    layout.minimumInteritemSpacing = 0;

    layout.minimumLineSpacing = 0;

    layout.scrollDirection = UICollectionViewScrollDirectionVertical;

    layout.headerReferenceSize = CGSizeMake(ScreenWidth, 40* PRHEIGHT);

    UICollectionView *classCollectionView = [[UICollectionView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight-55) collectionViewLayout:layout];

    classCollectionView.backgroundColor = RGBACOLOR(242,242,242,1);

    classCollectionView.showsVerticalScrollIndicator = NO;

    

    UIView *backView = [[UIView alloc]initWithFrame:CGRectMake(10*PRWIDTH,5*PRWIDTH, 20 *PRWIDTH, 10 *PRWIDTH)];

    backView.backgroundColor = [UIColor whiteColor];

    backView.layer.masksToBounds = YES;

    backView.layer.cornerRadius = 5;

    backView.layer.borderWidth = 1;

    backView.layer.borderColor = [UIColor lightGrayColor].CGColor;

    

    CGFloat margin  = 5*PRWIDTH;

    CGFloat imageView_H = backView.frame.size.height - 2*margin;

    UIImageView *logoImageView = [[UIImageView alloc]initWithFrame:CGRectMake(margin, margin, imageView_H, imageView_H)];

    logoImageView.layer.masksToBounds = YES;

    logoImageView.layer.cornerRadius = 10;

    

    CGFloat titleLabel_x = imageView_H + 3*margin;

    CGFloat titleLabel_W = backView.frame.size.width - titleLabel_x;

    UILabel *titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(titleLabel_x, 0.4*margin, titleLabel_W, 22*PRHEIGHT)];

    titleLabel.font = [UIFont systemFontOfSize:16];

    [backView addSubview:titleLabel];

    

    CGFloat subTitleLabel_y = titleLabel.bottom - 8*PRHEIGHT ;

    UILabel *subTitleLabel = [[UILabel alloc]initWithFrame:CGRectMake(titleLabel_x, subTitleLabel_y, titleLabel_W-10, 40*PRHEIGHT)];

    subTitleLabel.numberOfLines = 0;

    subTitleLabel.textColor = [UIColor lightGrayColor];

    subTitleLabel.font = [UIFont systemFontOfSize:10];

    [backView addSubview:subTitleLabel];

}

==========================================

代码模块2:

    CGRect frame1 = CGRectMake(0, 400, 72.0, 37.0);

    UIButton *button1 = [UIButton buttonWithType:UIButtonTypeRoundedRect];

    button1.frame = frame1;

    [button1 setTitle:@"新添加的按钮1" forState: UIControlStateNormal];

    button1.backgroundColor = [UIColor clearColor];

    button1.tag = 2000;

    [button1 addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside];

    

    CGRect frame2 = CGRectMake(0, 600, 72.0, 37.0);

    UIButton *button2 = [UIButton buttonWithType:UIButtonTypeRoundedRect];

    button2.frame = frame2;

    [button2 setTitle:@"新添加的按钮" forState: UIControlStateNormal];

    button2.backgroundColor = [UIColor clearColor];

    button2.tag = 3000;

    [button2 addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside];

    

    NSString *cString = @"#ff0000";//去掉前后空格换行符

    if ([cString length] < 6)  [UIColor redColor];

    // strip 0X if it appears

    if ([cString hasPrefix:@"0X"]) cString = [cString substringFromIndex:2];

    if ([cString hasPrefix:@"#"]) cString = [cString substringFromIndex:1];

    if ([cString length] != 6)  [UIColor redColor];

    NSRange range;

    range.location = 0;

    range.length = 2;

    NSString *rString = [cString substringWithRange:range];

    range.location = 2;

    NSString *gString = [cString substringWithRange:range];

    range.location = 4;

    NSString *bString = [cString substringWithRange:range];

    unsigned int r, g, b;

    [[NSScanner scannerWithString:rString] scanHexInt:&r];  //扫描16进制到int

    [[NSScanner scannerWithString:gString] scanHexInt:&g];

    [[NSScanner scannerWithString:bString] scanHexInt:&b];

    [UIColor colorWithRed:((float) r / 255.0f) green:((float) g / 255.0f) blue:((float) b / 255.0f) alpha:1.0f];


==========================================

代码块三:

- (void)addOtherCode{

    UIImageView *logoImage = [[UIImageView alloc]initWithFrame:CGRectMake(15*PRWIDTH, 10*PRHEIGHT, 40*PRWIDTH, 40*PRHEIGHT)];

    logoImage.layer.masksToBounds = YES;

    logoImage.layer.cornerRadius = 5;

    logoImage.layer.borderWidth = 1.0f;

    logoImage.layer.borderColor = [UIColor lightGrayColor].CGColor;

    UILabel *titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(65*PRWIDTH,10*PRHEIGHT , ScreenWidth-65*PRWIDTH, 22*PRHEIGHT)];

    titleLabel.font = [UIFont systemFontOfSize:14];

    UILabel *subTitleLabel = [[UILabel alloc]initWithFrame:CGRectMake(65*PRWIDTH, titleLabel.bottom + 8*PRHEIGHT, ScreenWidth-65*PRWIDTH, 18*PRHEIGHT)];

    subTitleLabel.font = [UIFont systemFontOfSize:12];

    subTitleLabel.textColor = [UIColor lightGrayColor];

    UILabel *readCountLabel = [[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth-215*PRWIDTH, titleLabel.bottom + 8*PRHEIGHT, 200*PRWIDTH, 18*PRHEIGHT)];

    readCountLabel.font = [UIFont systemFontOfSize:12];

    readCountLabel.textColor = [UIColor lightGrayColor];

    readCountLabel.textAlignment = NSTextAlignmentRight;

    int intvalue=arc4random_uniform(200 + 1);

    readCountLabel.text = [NSString stringWithFormat:@"%d人阅读",intvalue+400];

    titleLabel.textAlignment = NSTextAlignmentCenter;

    titleLabel.text = @"1235";

    UILabel *moneyT = [[UILabel alloc]initWithFrame:CGRectMake(0, titleLabel.bottom + 15*PRHEIGHT, ScreenWidth*0.5, 18*PRHEIGHT)];

    moneyT.textAlignment = NSTextAlignmentCenter;

    moneyT.font = [UIFont systemFontOfSize:12];

    moneyT.text = @"56489:";

    UITextField *money = [[UITextField alloc]initWithFrame:CGRectMake(ScreenWidth*0.5, titleLabel.bottom + 12*PRHEIGHT, ScreenWidth*0.5-50*PRWIDTH, 24*PRHEIGHT)];

    money.layer.borderColor = [UIColor lightGrayColor].CGColor;

    money.layer.borderWidth = 1.0f;

    money.keyboardType = UIKeyboardTypeDecimalPad;

    money.font = [UIFont systemFontOfSize:12];

    money.placeholder = @"请输入";

    UILabel *countT = [[UILabel alloc]initWithFrame:CGRectMake(0, moneyT.bottom + 15*PRHEIGHT, ScreenWidth*0.5, 18*PRHEIGHT)];

    countT.textAlignment = NSTextAlignmentCenter;

    countT.font = [UIFont systemFontOfSize:12];

    countT.text = @"741852:";

    UILabel *count = [[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth*0.5, moneyT.bottom + 12*PRHEIGHT, ScreenWidth*0.5-50*PRWIDTH, 24*PRHEIGHT)];

    count.textAlignment = NSTextAlignmentCenter;

    count.layer.borderColor = [UIColor lightGrayColor].CGColor;

    count.layer.borderWidth = 1.0f;

    count.font = [UIFont systemFontOfSize:12];

    count.userInteractionEnabled = YES;

    [count addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(countChange)]];

    UIImageView *upImage = [[UIImageView alloc]initWithFrame:CGRectMake(count.width-29*PRWIDTH, 19*PRHEIGHT*0.5, 9*PRWIDTH, 5*PRHEIGHT)];

    upImage.image = [UIImage imageNamed:@"向下"];

    UILabel *payT = [[UILabel alloc]initWithFrame:CGRectMake(0, countT.bottom + 15*PRHEIGHT, ScreenWidth*0.5, 18*PRHEIGHT)];

    payT.textAlignment = NSTextAlignmentCenter;

    payT.font = [UIFont systemFontOfSize:12];

    payT.text = @"2646";

    UILabel *pay = [[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth*0.5, countT.bottom + 12*PRHEIGHT, ScreenWidth*0.5-50*PRWIDTH, 24*PRHEIGHT)];

    pay.textAlignment = NSTextAlignmentCenter;

    pay.text = @"15156";

    pay.layer.borderColor = [UIColor lightGrayColor].CGColor;

    pay.layer.borderWidth = 1.0f;

    pay.font = [UIFont systemFontOfSize:12];

    pay.userInteractionEnabled = YES;

    [pay addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(payChange)]];

}

==========================================

模块四:

- (void)addCheckContent{

    UIAlertController *actionSheet = [UIAlertController alertControllerWithTitle:@"月薪要求" message:nil preferredStyle:UIAlertControllerStyleActionSheet];

    UIAlertAction *maleAction = [UIAlertAction actionWithTitle:@"面议" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {

    }];

    UIAlertAction *femaleAction = [UIAlertAction actionWithTitle:@"3000以下" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {

    }];

    UIAlertAction *babyAction = [UIAlertAction actionWithTitle:@"3000-5000元" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {

    }];

    UIAlertAction *babyAction2 = [UIAlertAction actionWithTitle:@"5000-8000元" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {

    }];

    UIAlertAction *babyAction3 = [UIAlertAction actionWithTitle:@"8000-10000元" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {

    }];

    UIAlertAction *babyAction4 = [UIAlertAction actionWithTitle:@"10000元以上" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {

    }];

    [actionSheet addAction:maleAction];

    [actionSheet addAction:femaleAction];

    [actionSheet addAction:babyAction];

    [actionSheet addAction:babyAction2];

    [actionSheet addAction:babyAction3];

    [actionSheet addAction:babyAction4];

    UIButton *saveButton = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 40*PRWIDTH, 24*PRHEIGHT)];

    [saveButton setTitle:@"保存" forState:UIControlStateNormal];

    [saveButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];

    UILabel *titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(15*PRWIDTH, 0, ScreenWidth*0.7, 22*PRHEIGHT)];

    titleLabel.font = [UIFont systemFontOfSize:15];

    UILabel *subTitleLabel = [[UILabel alloc]initWithFrame:CGRectMake(15*PRWIDTH, titleLabel.bottom, ScreenWidth*0.7, 18*PRHEIGHT)];

    subTitleLabel.textColor = [UIColor lightGrayColor];

    subTitleLabel.font = [UIFont systemFontOfSize:12];

    UIButton *deleteBtn = [[UIButton alloc]initWithFrame:CGRectMake(ScreenWidth-42*PRWIDTH, 9*PRHEIGHT, 22*PRWIDTH, 22*PRHEIGHT)];

    deleteBtn.imageView.contentMode = UIViewContentModeScaleAspectFit;

    [deleteBtn setImage:[UIImage imageNamed:@"删除"] forState:UIControlStateNormal];

    [deleteBtn addTarget:self action:@selector(didClickDeleteBtn) forControlEvents:UIControlEventTouchUpInside];

}


==========================================

模块五:

- (void) addContentSubView{

    UIButton *topImageView = [[UIButton alloc]initWithFrame:CGRectMake(30, 30, ScreenWidth - 60, 50)];

    topImageView.alpha = 1;

    topImageView.tag = 1002;

    UIButton *conentImage = [[UIButton alloc]initWithFrame:CGRectMake(10, 70, ScreenWidth - 20, 300)];

    conentImage.tag = 1000;

    conentImage.alpha = 1;

    UIButton *xcImage = [[UIButton alloc]initWithFrame:CGRectMake(ScreenWidth - 70, 15, 20, 65)];

    xcImage.tag = 1001;

    xcImage.userInteractionEnabled = YES;

    xcImage.alpha = 1;

    UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(qxCliak)];

    [xcImage addGestureRecognizer:tap];

    UIButton *defenLab = [[UIButton alloc]initWithFrame:CGRectMake(50, 80, conentImage.frame.size.width - 100, 30)];

    defenLab.font = [UIFont systemFontOfSize:17];

    UIButton *pinjiaLab = [[UIButton alloc]initWithFrame:CGRectMake(50, 110, conentImage.frame.size.width - 100, 30)];

    pinjiaLab.font = [UIFont systemFontOfSize:17];

    UIButton *zhidaoLab = [[UIButton alloc]initWithFrame:CGRectMake(50 , 170, conentImage.frame.size.width - 100, 50)];

    zhidaoLab.font = [UIFont systemFontOfSize:13];

    UIButton *shenbaoBtn = [UIButton buttonWithType:(UIButtonTypeSystem)];

    shenbaoBtn.frame = CGRectMake(ScreenWidth/2 - 100, 230,180, 45);

    UIImage *image = [UIImage imageNamed:@"btn_ljlx"];

    CGFloat top = 0;

    CGFloat bottom = 0 ;

    CGFloat left = 0;

    CGFloat right = 0;

    UIEdgeInsets insets = UIEdgeInsetsMake(top, left, bottom, right);

    image = [image resizableImageWithCapInsets:insets resizingMode:UIImageResizingModeTile];

    shenbaoBtn.backgroundColor = [UIColor colorWithPatternImage:image];

    [shenbaoBtn addTarget:self action:@selector(shenbaoClick:) forControlEvents:(UIControlEventTouchUpInside)];

    conentImage.userInteractionEnabled = YES;

    UIButton *image1 = (UIButton *)[self.view viewWithTag:1000];

    UIButton *image2 = (UIButton *)[self.view viewWithTag:1001];

    UIButton *image3 = (UIButton *)[self.view viewWithTag:1002];

    [image1 removeFromSuperview];

    [image2 removeFromSuperview];

    [image3 removeFromSuperview];

}

==========================================

模块六:

- (void)addSubContentView{

    UIImageView *topImageView = [[UIImageView alloc]initWithFrame:CGRectMake((40*PRWIDTH)*0.5, 10*PRHEIGHT, 40*PRWIDTH, 40*PRHEIGHT)];

    topImageView.contentMode = UIViewContentModeScaleAspectFit;

    UILabel *bottomTitle = [[UILabel alloc]initWithFrame:CGRectMake(0, topImageView.bottom + 10*PRHEIGHT, 100, 20*PRHEIGHT)];

    bottomTitle.textAlignment = NSTextAlignmentCenter;

    bottomTitle.font = [UIFont systemFontOfSize:13];

    UILabel *numberLabel = [[UILabel alloc]initWithFrame:CGRectMake(15*PRWIDTH, 12*PRHEIGHT, 25*PRWIDTH, 25*PRHEIGHT)];

    numberLabel.layer.masksToBounds = YES;

    numberLabel.layer.cornerRadius = 10;

    numberLabel.textAlignment = NSTextAlignmentCenter;

    UILabel *DTtitleLabel = [[UILabel alloc]initWithFrame:CGRectMake(numberLabel.right+15, 12*PRHEIGHT, numberLabel.right-15, 22*PRHEIGHT)];

    UILabel *DTsubTitleLabel = [[UILabel alloc]initWithFrame:CGRectMake(numberLabel.right+15, DTtitleLabel.bottom+4, DTtitleLabel.width, 14*PRHEIGHT)];

    DTsubTitleLabel.font = [UIFont systemFontOfSize:12];

    DTsubTitleLabel.textColor = [UIColor lightGrayColor];

    UILabel *cellTitleLabel = [[UILabel alloc]initWithFrame:CGRectMake(12*PRWIDTH, 15*PRHEIGHT, ScreenWidth - 12*PRWIDTH, 34*PRHEIGHT)];

    cellTitleLabel.text = @"fsfsdfasdfas?";

    UILabel *platformLabel = [[UILabel alloc]initWithFrame:CGRectMake(12*PRWIDTH, cellTitleLabel.bottom, ScreenWidth*0.5-12*PRWIDTH, 27*PRHEIGHT)];

    platformLabel.textColor = [UIColor lightGrayColor];

    platformLabel.font = [UIFont systemFontOfSize:14];

    platformLabel.text = @"fffff";

    UILabel *timeLabel = [[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth*0.5,  cellTitleLabel.bottom,ScreenWidth*0.5-12*PRWIDTH, 27*PRHEIGHT)];

    timeLabel.textAlignment = NSTextAlignmentRight;

    timeLabel.textColor = [UIColor lightGrayColor];

    timeLabel.font = [UIFont systemFontOfSize:14];

    timeLabel.text = @"2018-03-07";

    UIImageView *logoImage = [[UIImageView alloc]initWithFrame:CGRectMake(15*PRWIDTH, (80*PRHEIGHT-45*PRWIDTH)*0.5, 45*PRWIDTH, 45*PRWIDTH)];

    logoImage.layer.masksToBounds = YES;

    logoImage.layer.cornerRadius = 5;

    UILabel *nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(logoImage.right +8, 10*PRHEIGHT, ScreenWidth *0.5, 22*PRHEIGHT)];

    nameLabel.font = [UIFont systemFontOfSize:16];

    UILabel *addressLabel = [[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth*0.5, 10*PRHEIGHT, ScreenWidth*0.5 - 12*PRWIDTH, 22*PRHEIGHT)];

    addressLabel.textColor = [UIColor lightGrayColor];

    addressLabel.textAlignment = NSTextAlignmentRight;

    addressLabel.font = [UIFont systemFontOfSize:13];

    UILabel *aprTitleLabel = [[UILabel alloc]initWithFrame:CGRectMake(logoImage.right +8, nameLabel.bottom + 10, 70*PRWIDTH, 18*PRHEIGHT)];

    aprTitleLabel.textColor = [UIColor lightGrayColor];

    aprTitleLabel.font = [UIFont systemFontOfSize:13];

    aprTitleLabel.text = @"dsfs:";

    UILabel *aprLabel = [[UILabel alloc]initWithFrame:CGRectMake(aprTitleLabel.right, aprTitleLabel.y, 120*PRWIDTH, 18*PRHEIGHT)];

    aprLabel.font = [UIFont systemFontOfSize:13];

    UILabel *scoreTitleLabel = [[UILabel alloc]initWithFrame:CGRectMake(aprLabel.right, aprLabel.y, 70*PRWIDTH, 18*PRHEIGHT)];

    scoreTitleLabel.textColor = [UIColor lightGrayColor];

    scoreTitleLabel.font = [UIFont systemFontOfSize:13];

    scoreTitleLabel.text = @"dsdsf:";

    UILabel *scoreLabel = [[UILabel alloc]initWithFrame:CGRectMake(scoreTitleLabel.right, scoreTitleLabel.y, 40*PRWIDTH, 18*PRHEIGHT)];

    scoreLabel.font = [UIFont systemFontOfSize:13];

    UIImageView *blankImage =[[UIImageView alloc]initWithFrame:CGRectMake((ScreenWidth-204*PRWIDTH)*0.5, 80*PRHEIGHT, 204*PRWIDTH, 190*PRHEIGHT)];

    if (ScreenWidth < 375) {

        blankImage.y = 60*PRHEIGHT;

    }

    UILabel *blankLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, blankImage.bottom + 15, ScreenWidth, 20*PRHEIGHT)];

    blankLabel.textColor = [UIColor lightGrayColor];

    blankLabel.textAlignment = NSTextAlignmentCenter;

    UIButton *goAttentionBtn = [[UIButton alloc]initWithFrame:CGRectMake((ScreenWidth-80*PRWIDTH)*0.5, blankLabel.bottom + 25, 80*PRWIDTH, 30*PRHEIGHT)];

    [goAttentionBtn setTitle:@"去关注" forState:UIControlStateNormal];

    [goAttentionBtn setBackgroundColor:TOPICCOLOR];

    [goAttentionBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];

    goAttentionBtn.layer.masksToBounds = YES;

    goAttentionBtn.layer.cornerRadius = 15*PRHEIGHT;

    [goAttentionBtn addTarget:self action:@selector(didClickGoAttentionBtn) forControlEvents:UIControlEventTouchUpInside];

}

==========================================

模块七:

- (void)addSubContaintView{

    UILabel *moneyLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 100)];

    moneyLabel.font = [UIFont systemFontOfSize:24];

    moneyLabel.textAlignment = NSTextAlignmentCenter;

    UILabel *moneyLabelT = [[UILabel alloc]initWithFrame:CGRectMake(10*PRWIDTH, 107*PRHEIGHT, 70*PRWIDTH, 20*PRHEIGHT)];

    moneyLabelT.text = @"fsds";

    UILabel *moneyLabel22 = [[UILabel alloc]initWithFrame:CGRectMake(71*PRWIDTH, 107*PRHEIGHT, 100*PRWIDTH, 20*PRHEIGHT)];

    UILabel *paybackMoneyLabelT = [[UILabel alloc]initWithFrame:CGRectMake(10*PRWIDTH, moneyLabelT.bottom +10*PRHEIGHT, 70*PRWIDTH, 20*PRHEIGHT)];

    UILabel *paybackMoneyLabel = [[UILabel alloc]initWithFrame:CGRectMake(71*PRWIDTH, moneyLabelT.bottom +10*PRHEIGHT, 100*PRWIDTH, 20*PRHEIGHT)];

    UILabel *simpleDay = [[UILabel alloc]initWithFrame:CGRectMake(45*PRWIDTH, 112*PRHEIGHT, 90*PRWIDTH, 45*PRHEIGHT)];

    simpleDay.font = [UIFont systemFontOfSize:55];

    simpleDay.textColor = [UIColor whiteColor];

    simpleDay.userInteractionEnabled = NO;

    UIImageView *detailsView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 100, 70*PRHEIGHT)];

    detailsView.userInteractionEnabled = NO;

    UILabel *detailsDay = [[UILabel alloc]initWithFrame:CGRectMake(15*PRWIDTH, 15*PRHEIGHT, 15*PRWIDTH, 30*PRHEIGHT)];

    detailsDay.font = [UIFont systemFontOfSize:25];

    detailsDay.textColor = [UIColor whiteColor];

    detailsDay.userInteractionEnabled = NO;

    UILabel *moneyLabel2 = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 100)];

    moneyLabel2.font = [UIFont systemFontOfSize:24];

    moneyLabel2.textAlignment = NSTextAlignmentCenter;

    UILabel *moneyLabel3 = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 100)];

    moneyLabel3.font = [UIFont systemFontOfSize:24];

    moneyLabel3.textAlignment = NSTextAlignmentCenter;

    UILabel *moneyLabel4 = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 100)];

    moneyLabel4.font = [UIFont systemFontOfSize:24];

    moneyLabel4.textAlignment = NSTextAlignmentCenter;

    UILabel *moneyLabel5 = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 100)];

    moneyLabel5.font = [UIFont systemFontOfSize:24];

    moneyLabel5.textAlignment = NSTextAlignmentCenter;

    UILabel *moneyLabel6 = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 100)];

    moneyLabel6.font = [UIFont systemFontOfSize:24];

    moneyLabel6.textAlignment = NSTextAlignmentCenter;

    UILabel *moneyLabel7 = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 100)];

    moneyLabel7.font = [UIFont systemFontOfSize:24];

    moneyLabel7.textAlignment = NSTextAlignmentCenter;

    UILabel *moneyLabel8 = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 100)];

    moneyLabel8.font = [UIFont systemFontOfSize:24];

    moneyLabel8.textAlignment = NSTextAlignmentCenter;

    UILabel *moneyLabel9 = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 100)];

    moneyLabel9.font = [UIFont systemFontOfSize:24];

    moneyLabel9.textAlignment = NSTextAlignmentCenter;

}

==========================================

模块八:

    UIView *btnsBgView1 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 50)];

    btnsBgView1.backgroundColor = [UIColor whiteColor];

    UILabel *phoneText1 = [[UILabel alloc]initWithFrame:CGRectMake(20, 20 , ScreenWidth, 20)];

    phoneText1.font = [UIFont systemFontOfSize:16];

    phoneText1.textColor = [UIColor grayColor];//其中textColor要用UIColor类型

    phoneText1.text = @"系统类型:iOS";

    UILabel *phoneText2 = [[UILabel alloc]initWithFrame:CGRectMake(20, 50 , ScreenWidth, 20)];

    phoneText2.font = [UIFont systemFontOfSize:16];

    phoneText2.textColor = [UIColor grayColor];//其中textColor要用UIColor类型

    NSString* path = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] ;

    NSFileManager* fileManager = [[NSFileManager alloc ]init];

    NSDictionary *fileSysAttributes = [fileManager attributesOfFileSystemForPath:path error:nil];

    NSNumber *freeSpace = [fileSysAttributes objectForKey:NSFileSystemFreeSize];

    NSNumber *totalSpace = [fileSysAttributes objectForKey:NSFileSystemSize];

    NSString  * str= [NSString stringWithFormat:@"已使用:%0.1fG/剩余:%0.1fG",([totalSpace longLongValue] - [freeSpace longLongValue])/1024.0/1024.0/1024.0,[freeSpace longLongValue]/1024.0/1024.0/1024.0];

    phoneText2.text = [@"内存:" stringByAppendingString:str];

    UILabel *phoneText3 = [[UILabel alloc]initWithFrame:CGRectMake(20, 80 , ScreenWidth, 20)];

    phoneText3.font = [UIFont systemFontOfSize:16];

    phoneText3.textColor = [UIColor grayColor];//其中textColor要用UIColor类型

    phoneText3.text = @"估价:";

    UILabel *phoneText4 = [[UILabel alloc]initWithFrame:CGRectMake(20, 110 , ScreenWidth, 40)];

    phoneText4.font = [UIFont systemFontOfSize:40];

    phoneText4.textColor = [UIColor blackColor];//其中textColor要用UIColor类型

    NSUserDefaults* ud = [NSUserDefaults standardUserDefaults];

    phoneText4.text = @"";

    UILabel *phoneText5 = [[UILabel alloc]initWithFrame:CGRectMake(20, 160 , ScreenWidth, 20)];

    phoneText5.font = [UIFont systemFontOfSize:16];

    phoneText5.textColor = [UIColor grayColor];//其中textColor要用UIColor类型

    phoneText5.text = @"此为找工作平台。";

    UIView *btnsBgView2 = [[UIView alloc] initWithFrame:CGRectMake(0, 190, ScreenWidth, 10)];

    btnsBgView2.backgroundColor = [UIColor colorWithHexString:@"#fafafa"];

    UIView *btnsBgView3 = [[UIView alloc] initWithFrame:CGRectMake(0, 200, ScreenWidth, 10)];

    btnsBgView3.backgroundColor = [UIColor whiteColor];

    UILabel *phoneText6 = [[UILabel alloc]initWithFrame:CGRectMake(20, 10 , ScreenWidth / 2, 20)];

    phoneText6.font = [UIFont systemFontOfSize:16];

    phoneText6.textColor = [UIColor blackColor];//其中textColor要用UIColor类型

    phoneText6.text = @"我的机况:";


==========================================

模块九:

==========================================






发布了56 篇原创文章 · 获赞 12 · 访问量 7万+

猜你喜欢

转载自blog.csdn.net/huwan12345/article/details/79413631
4.3
今日推荐