文件名称:IOS自动布局XIB和CODE,附代码和PPT
文件大小:10.18MB
文件格式:ZIP
更新时间:2016-08-04 08:49:43
ios autolayout constraint
核心代码: - (void)addVisualConstraints:(NSString *)constraintString forViews:(NSDictionary *)views { [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:constraintString options:0 metrics:0 views:views]]; } NSDictionary *views = NSDictionaryOfVariableBindings(self.view, btnBack, btnShare, btnDetail, btnLikes); [self.view addVisualConstraints:@"|-10-[btnBack]" forViews:views]; [self.view addVisualConstraints:@"[btnShare]-10-|" forViews:views]; [self.view addVisualConstraints:@"|-10-[btnDetail]" forViews:views]; [self.view addVisualConstraints:@"V:[btnDetail]-10-|" forViews:views]; [self.view addVisualConstraints:@"[btnLikes]-10-|" forViews:views]; [self.view addVisualConstraints:@"V:[btnLikes]-10-|" forViews:views];
【文件预览】:
autolayout.pptx
testAutoLayoutTwo
----testAutoLayoutTwo.xcodeproj()
--------project.xcworkspace()
--------project.pbxproj(19KB)
--------xcuserdata()
----.git()
--------index(3KB)
--------hooks()
--------config(138B)
--------description(73B)
--------refs()
--------branches()
--------logs()
--------objects()
--------info()
--------COMMIT_EDITMSG(15B)
--------HEAD(23B)
----.DS_Store(6KB)
----testAutoLayoutTwo()
--------main.m(340B)
--------UIView+Constraint.m(635B)
--------Default.png(6KB)
--------images()
--------testViewController.h(257B)
--------AppDelegate.h(368B)
--------AppDelegate.m(2KB)
--------Default-568h@2x.png(18KB)
--------testViewController.m(2KB)
--------testAutoLayoutTwo-Prefix.pch(337B)
--------testAutoLayoutTwo-Info.plist(1KB)
--------UIView+Constraint.h(299B)
--------Default@2x.png(16KB)
--------ViewController.h(219B)
--------ViewController.m(1KB)
--------en.lproj()