Skip to content

Commit f7bad9d

Browse files
committed
新增子页面间互相跳转,新增隐藏标题栏
1 parent 83855c9 commit f7bad9d

File tree

11 files changed

+74
-53
lines changed

11 files changed

+74
-53
lines changed

.DS_Store

0 Bytes
Binary file not shown.
6 KB
Binary file not shown.

Demo_pageLinkage/Assets.xcassets/AppIcon.appiconset/Contents.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@
3939
"idiom" : "iphone",
4040
"size" : "60x60",
4141
"scale" : "3x"
42+
},
43+
{
44+
"idiom" : "ios-marketing",
45+
"size" : "1024x1024",
46+
"scale" : "1x"
4247
}
4348
],
4449
"info" : {
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"filename" : "image.png",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"scale" : "2x"
11+
},
12+
{
13+
"idiom" : "universal",
14+
"scale" : "3x"
15+
}
16+
],
17+
"info" : {
18+
"version" : 1,
19+
"author" : "xcode"
20+
}
21+
}
Loading

Demo_pageLinkage/MCPageViewController/MCPageViewController.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020
当设置 barHeight 为负数时候,隐藏标题栏。 实例:当有有且只有一个子页面的时候
2121
*/
2222
@property (nonatomic, assign) CGFloat barHeight;
23-
24-
25-
@property (nonatomic, assign) CGFloat blockFont; // 标题块的字体的大小 默认18
23+
@property (nonatomic, assign) CGFloat blockFont; // 标题块的字体的大小 默认15
2624
@property (nonatomic, strong) UIColor * blockColor; // 标题块的背景颜色
2725

2826

Demo_pageLinkage/MCPageViewController/MCPageViewController.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,7 @@ - (void)reference_baseSetting {
189189
//
190190
if (_barHeight < 0) { _barHeight = 0; }
191191

192-
193-
if (_blockFont < 14) { _blockFont = 18; }
192+
if (_blockFont < 14) { _blockFont = 15; }
194193

195194
if (_blockColor == nil) { _blockColor = [UIColor whiteColor]; }
196195

Demo_pageLinkage/PageViewController.m

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,19 @@ - (void)viewDidLoad {
3333
one.str = dataArray[i];
3434
[vcArrayM addObject:one];
3535

36-
37-
38-
// 子页面上点击事件的处理
36+
// 子页面上点击事件的处理 --> push到下个页面
3937
__weak __typeof__(self) weakSelf = self;
4038
one.oneBlock = ^(NSString *string, UIViewController *vc) {
4139
vc.title = string;
4240
[weakSelf.navigationController pushViewController:vc animated:YES];
4341
};
4442

43+
// 子页面上点击事件的处理 --> 跳转到其他pageViewController的子页面
4544
one.twoBlock = ^(int index) {
4645
[weakSelf jumpToSubViewController:index];
4746
};
4847

4948
}
50-
5149
self.blockFont = 14;
5250
self.barHeight = 40;
5351

Demo_pageLinkage/PushViewController.m

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,13 @@ @implementation PushViewController
1616

1717
- (void)viewDidLoad {
1818
[super viewDidLoad];
19-
// Do any additional setup after loading the view.
20-
self.view.backgroundColor = [UIColor whiteColor];
21-
}
22-
23-
- (void)didReceiveMemoryWarning {
24-
[super didReceiveMemoryWarning];
25-
// Dispose of any resources that can be recreated.
26-
}
2719

28-
/*
29-
#pragma mark - Navigation
30-
31-
// In a storyboard-based application, you will often want to do a little preparation before navigation
32-
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
33-
// Get the new view controller using [segue destinationViewController].
34-
// Pass the selected object to the new view controller.
20+
self.view.backgroundColor = [UIColor whiteColor];
21+
22+
UIImageView * iv = [[UIImageView alloc] init];
23+
iv.image = [UIImage imageNamed:@"image"];
24+
iv.frame = CGRectMake(0, 0, 708/2.5, 824/2.5);
25+
iv.center = CGPointMake(self.view.center.x, self.view.center.y - 100);
26+
[self.view addSubview:iv];
3527
}
36-
*/
37-
3828
@end

0 commit comments

Comments
 (0)