zoukankan      html  css  js  c++  java
  • 设置tabbar的角标与第三方库Masonry的基本使用

    // 设置tabbar的角标

     [[[[[self tabBarController] viewControllers] objectAtIndex: 0] tabBarItem] setBadgeValue:[NSString stringWithFormat:@"%ld",(long)number]];

    //字符的替换

    NSString *String = @"123|study:demo”;

    String = [String stringByReplacingOccurrencesOfString:@“|" withString:@""

    ];

    String = [String stringByReplacingOccurrencesOfString:@“:" withString:@""

    ];

    //Masonry的基本使用

    - (void) layoutSubPages{

        [self.topView mas_makeConstraints:^(MASConstraintMaker *make) {

            make.top.mas_equalTo(self.view.mas_top);

            make.left.and.right.mas_equalTo(self.view);

            make.height.mas_equalTo(64);

        }];

        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {

            make.centerY.mas_equalTo(self.topView.mas_centerY).offset(10);

            make.centerX.mas_equalTo(self.view.mas_centerX);

            make.size.mas_equalTo(CGSizeMake(120, 44));

        }];

        [self.backButton mas_makeConstraints:^(MASConstraintMaker *make) {

            make.centerY.mas_equalTo(self.topView.mas_centerY).offset(10);

            make.left.mas_equalTo(self.view.mas_left);

            make.size.mas_equalTo(CGSizeMake(40, 39));

        }];

        [self.scrollView mas_makeConstraints:^(MASConstraintMaker *make) {

            make.top.mas_equalTo(self.topView.mas_bottom);

            make.left.and.right.mas_equalTo(self.view);

            make.height.mas_equalTo(42);

        }];

        [self.scrollView1 mas_makeConstraints:^(MASConstraintMaker *make) {

            make.top.mas_equalTo(self.scrollView.mas_bottom);

            make.left.right.and.bottom.mas_equalTo(self.view);

        }];

    }

  • 相关阅读:
    UVA 110 Meta-Loopless Sorts(输出挺麻烦的。。。)
    使用bash判断PATH中是否存在某个路径
    Palindrome(poj3974)(manacher算法)
    Highcharts简介
    android 4.3源码编译
    Unsupervised Feature Learning and Deep Learning(UFLDL) Exercise 总结
    借助Ant工具,实现快速开发
    关于tableView的简单实例
    Matlab单元(Cell)数据的应用
    spring 资源加载使用说明
  • 原文地址:https://www.cnblogs.com/CodingMann/p/5066496.html
Copyright © 2011-2022 走看看