-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Apple
authored and
Apple
committed
Nov 6, 2018
1 parent
6c5e844
commit af380aa
Showing
14 changed files
with
312 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...JHFrameLayoutDemo.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>BuildSystemType</key> | ||
<string>Original</string> | ||
</dict> | ||
</plist> |
Binary file added
BIN
+40.7 KB
...xcodeproj/project.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
18 changes: 18 additions & 0 deletions
18
...o.xcodeproj/project.xcworkspace/xcuserdata/apple.xcuserdatad/WorkspaceSettings.xcsettings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>BuildLocationStyle</key> | ||
<string>UseAppPreferences</string> | ||
<key>CustomBuildLocationType</key> | ||
<string>RelativeToDerivedData</string> | ||
<key>DerivedDataLocationStyle</key> | ||
<string>Default</string> | ||
<key>EnabledFullIndexStoreVisibility</key> | ||
<false/> | ||
<key>IssueFilterStyle</key> | ||
<string>ShowActiveSchemeOnly</string> | ||
<key>LiveSourceIssuesEnabled</key> | ||
<true/> | ||
</dict> | ||
</plist> |
5 changes: 5 additions & 0 deletions
5
...ameLayoutDemo.xcodeproj/xcuserdata/apple.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Bucket | ||
type = "1" | ||
version = "2.0"> | ||
</Bucket> |
14 changes: 14 additions & 0 deletions
14
...FrameLayoutDemo.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/xcschememanagement.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>SchemeUserState</key> | ||
<dict> | ||
<key>JHFrameLayoutDemo.xcscheme_^#shared#^_</key> | ||
<dict> | ||
<key>orderHint</key> | ||
<integer>0</integer> | ||
</dict> | ||
</dict> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
JHFrameLayoutDemo/JHFrameLayoutDemo/DemoVC/Demo13ViewController.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// Demo13ViewController.h | ||
// JHFrameLayoutDemo | ||
// | ||
// Created by xuejinghao on 2018/11/5. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface Demo13ViewController : UIViewController | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
131 changes: 131 additions & 0 deletions
131
JHFrameLayoutDemo/JHFrameLayoutDemo/DemoVC/Demo13ViewController.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
// | ||
// Demo13ViewController.m | ||
// JHFrameLayoutDemo | ||
// | ||
// Created by xuejinghao on 2018/11/5. | ||
// | ||
|
||
#import "Demo13ViewController.h" | ||
#import "JHFrameLayout.h" | ||
|
||
@interface CustomView: JHFrameLayoutView | ||
@end | ||
@implementation CustomView | ||
@end | ||
|
||
@interface Demo13ViewController () | ||
|
||
@end | ||
|
||
@implementation Demo13ViewController | ||
|
||
- (void)viewDidLoad { | ||
[super viewDidLoad]; | ||
// Do any additional setup after loading the view. | ||
|
||
/** | ||
a custom view inherit JHFrameLayoutView | ||
自定义的view 继承自 JHFrameLayoutView | ||
*/ | ||
|
||
self.navigationItem.title = @"Demo13"; | ||
|
||
self.view.backgroundColor = [UIColor whiteColor]; | ||
|
||
CustomView *view = [[CustomView alloc] init]; | ||
view.frame = CGRectMake(10, CGRectGetMaxY(self.navigationController.navigationBar.frame) + 10, CGRectGetWidth(self.view.frame)-20, 300); | ||
view.backgroundColor = [UIColor redColor]; | ||
[self.view addSubview:view]; | ||
|
||
UIView *layoutView = [[UIView alloc] init]; | ||
layoutView.backgroundColor = [UIColor lightGrayColor]; | ||
[view addSubview:layoutView]; | ||
|
||
UIView *view1 = [[UIView alloc] init]; | ||
view1.backgroundColor = [UIColor redColor]; | ||
[layoutView addSubview:view1]; | ||
|
||
UIView *view2 = [[UIView alloc] init]; | ||
view2.backgroundColor = [UIColor greenColor]; | ||
[layoutView addSubview:view2]; | ||
|
||
UIView *view3 = [[UIView alloc] init]; | ||
view3.backgroundColor = [UIColor blueColor]; | ||
[layoutView addSubview:view3]; | ||
|
||
UIView *view4 = [[UIView alloc] init]; | ||
view4.backgroundColor = [UIColor purpleColor]; | ||
[layoutView addSubview:view4]; | ||
|
||
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; | ||
button.frame = CGRectMake(10, CGRectGetHeight(self.view.frame) - 50, CGRectGetWidth(self.view.frame)-20 , 30); | ||
button.backgroundColor = [UIColor lightGrayColor]; | ||
button.titleLabel.font = [UIFont systemFontOfSize:16]; | ||
[button setTitle:@"Change Red View Frame" forState:0]; | ||
[button setTitleColor:[UIColor blackColor] forState:0]; | ||
[button addTarget:self action:@selector(buttonEVent) forControlEvents:1<<6]; | ||
[self.view addSubview:button]; | ||
|
||
view.tag = 100; | ||
layoutView.tag = 200; | ||
view1.tag = 201; | ||
view2.tag = 202; | ||
view3.tag = 203; | ||
view4.tag = 204; | ||
|
||
layoutView.jhLayout | ||
.topOffsetBottomOfView(15, self.navigationController.navigationBar, NO) | ||
.leftIs(10) | ||
.rightOffsetRightOfView(-20, self.view, YES) | ||
.bottomOffsetBottomOfView(-10, view, YES); | ||
|
||
view1.jhLayout | ||
.topIs(10) | ||
.leftIs(10) | ||
.sizeIs(CGSizeMake(50, 50)); | ||
|
||
view2.jhLayout | ||
.sizeIs(CGSizeMake(50, 50)) | ||
.rightOffsetRightOfView(-10, layoutView, NO) | ||
.topIs(10); | ||
|
||
view3.jhLayout | ||
.sizeIs(CGSizeMake(50, 50)) | ||
.leftIs(10) | ||
.bottomOffsetBottomOfView(-10, layoutView, NO); | ||
|
||
view4.jhLayout | ||
.sizeIs(CGSizeMake(50, 50)) | ||
.rightOffsetRightOfView(-10, layoutView, NO) | ||
.bottomOffsetBottomOfView(-10, layoutView, NO); | ||
|
||
} | ||
|
||
- (void)buttonEVent | ||
{ | ||
UIView *view = [self.view viewWithTag:100]; | ||
CGRect frame = view.frame; | ||
|
||
if (frame.size.height == 300) { | ||
frame.size.height = 400; | ||
view.frame = frame; | ||
}else{ | ||
frame.size.height = 300; | ||
view.frame = frame; | ||
} | ||
} | ||
|
||
/* | ||
#pragma mark - Navigation | ||
// In a storyboard-based application, you will often want to do a little preparation before navigation | ||
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { | ||
// Get the new view controller using [segue destinationViewController]. | ||
// Pass the selected object to the new view controller. | ||
} | ||
*/ | ||
|
||
@end |
16 changes: 16 additions & 0 deletions
16
JHFrameLayoutDemo/JHFrameLayoutDemo/DemoVC/Demo14ViewController.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// Demo14ViewController.h | ||
// JHFrameLayoutDemo | ||
// | ||
// Created by Apple on 2018/11/6. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface Demo14ViewController : UIViewController | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
Oops, something went wrong.