Latest 0.0.1
Homepage https://github.com/annidy/MMLayout
License BSD
Platforms ios 6.0, requires ARC
Authors
  • 简单的Frame 设置封装 支持链接方式编程

链接方式编写


    UIView *newView = [UIView new];
    [self.view addSubview:newView];  
    newView.m_height(50).m_width(100).m_right(10).m_top(10);

父类居中


    设置父类居中前提是自己本身有宽度和高度
    UIView *newView = [UIView new]; 
    [self.view addSubview:newView]; 
    newView.m_height(50).m_width(100).m_center();   

相同设置


    UIView *redView = [UIView new];  
    [self.view addSubview:redView]; 

    UIView *redView1 = [UIView new];  
    [self.view addSubview:redView1];  

    UIView *redView2 = [UIView new];  
    [self.view addSubview:redView2]; 

    UIView *redView3 = [UIView new];  
    [self.view addSubview:redView3]; 

    redView.m_left(10).m_top(10).m_size(CGSize(50,50));  

    redView1.m_equalToTop(redView).m_equalToSize(redView).m_left(redView.mm_maxX + 10); 

    redView2.m_equalToTop(redView1).m_equalToSize(redView1).m_left(redView1.mm_maxX + 10); 

    redView3.m_equalToTop(redView2).m_equalToSize(redView2).m_left(redView2.mm_maxX + 10); 

线性布局

    UIView *redView = [UIView new];  
    [self.view addSubview:redView]; 

    UIView *redView1 = [UIView new];  
    [self.view addSubview:redView1];  

    UIView *redView2 = [UIView new];  
    [self.view addSubview:redView2]; 

    UIView *redView3 = [UIView new];  
    [self.view addSubview:redView3]; 

    redView.m_left(10).m_top(10).m_size(CGSize(50,50)); 
    redView1.m_equalToSize(redView).m_hstack(10); 
    redView2.m_equalToSize(redView).m_hstack(10); 
    redView3.m_equalToSize(redView).m_hstack(10); 

以上就是简单的使用方式 链接方式 和block的方式

Latest podspec

{
    "name": "MMLayout",
    "version": "0.0.1",
    "license": {
        "type": "BSD"
    },
    "homepage": "https://github.com/annidy/MMLayout",
    "authors": {
        "annidy": "[email protected]"
    },
    "summary": "Simple frame layout for iOS.",
    "description": "Better frame layout than use setFrame.",
    "source": {
        "git": "https://github.com/annidy/MMLayout.git",
        "tag": "v0.0.1"
    },
    "source_files": "*.{h,m}",
    "requires_arc": true,
    "platforms": {
        "ios": "6.0"
    }
}

Pin It on Pinterest

Share This