Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
GMBase
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
GMBase
Commits
ea5e0443
Commit
ea5e0443
authored
Jan 18, 2018
by
汪洋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化导航栏标题过长时的显示
parent
4bdef917
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
9 deletions
+30
-9
GMListViewController.m
Example/GMBase/GMListViewController.m
+4
-2
GMViewController.m
Example/GMBase/GMViewController.m
+1
-1
Contents.json
...e/GMBase/Images.xcassets/AppIcon.appiconset/Contents.json
+5
-0
Podfile
Example/Podfile
+1
-1
Podfile.lock
Example/Podfile.lock
+3
-3
OCNavigationBar.m
GMBase/Classes/OCNavigationBar.m
+16
-2
No files found.
Example/GMBase/GMListViewController.m
View file @
ea5e0443
...
...
@@ -25,8 +25,10 @@
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
NSLog
(
@"%@"
,
self
.
referer
);
self
.
navigationBar
.
title
=
@"列表"
;
self
.
navigationBar
.
rightTitle
=
@"没什么用"
;
self
.
navigationBar
.
title
=
@"你好我是汪洋,我在更美工作,很开心,哈哈哈哈哈哈"
;
// self.navigationBar.rightTitle = @"举报有奖";
self
.
navigationBar
.
nearRightIcon
=
@"back"
;
self
.
navigationBar
.
rightIcon
=
@"back"
;
_table
.
separatorStyle
=
UITableViewCellSeparatorStyleSingleLine
;
[
_table
registerClass
:[
UITableViewCell
class
]
forCellReuseIdentifier
:
@"cell"
];
}
...
...
Example/GMBase/GMViewController.m
View file @
ea5e0443
...
...
@@ -19,7 +19,7 @@
{
[
super
viewDidLoad
];
self
.
pageName
=
@"yw"
;
self
.
title
=
@"你好"
;
self
.
title
=
@"你好
我是汪洋,我在更美工作,很开心,哈哈哈哈哈哈
"
;
}
...
...
Example/GMBase/Images.xcassets/AppIcon.appiconset/Contents.json
View file @
ea5e0443
...
...
@@ -84,6 +84,11 @@
"idiom"
:
"ipad"
,
"size"
:
"83.5x83.5"
,
"scale"
:
"2x"
},
{
"idiom"
:
"ios-marketing"
,
"size"
:
"1024x1024"
,
"scale"
:
"1x"
}
],
"info"
:
{
...
...
Example/Podfile
View file @
ea5e0443
...
...
@@ -4,7 +4,7 @@ platform :ios, '8.0'
#open source
source
'https://github.com/CocoaPods/Specs.git'
#our company
source
'git@git.
gengmei.cc
:gengmeiios/GMSpecs.git'
source
'git@git.
wanmeizhensuo.com
:gengmeiios/GMSpecs.git'
target
'GMBase_Example'
do
pod
'GMBase'
,
:path
=>
'../'
...
...
Example/Podfile.lock
View file @
ea5e0443
...
...
@@ -14,7 +14,7 @@ PODS:
- AFNetworking/Serialization (3.1.0)
- AFNetworking/UIKit (3.1.0):
- AFNetworking/NSURLSession
- GMBase (0.
2.2
):
- GMBase (0.
3.0
):
- GMHud
- GMKit
- GMNetService
...
...
@@ -88,7 +88,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
GMBase:
4b5007e5bf6de3ffd54c2ce132ac7fa58b8c7a52
GMBase:
1654a1e7146647d619e536f3ecb97e6a37b83f91
GMCache: fb0af70b420715ef9519487fdd932a357b3cd8d4
GMHud: 74387462a8b9f099c760a1ddbf493cc86da7cdbc
GMKit: 4820e0eb7727735f88fb2f983f178edd074343c1
...
...
@@ -103,6 +103,6 @@ SPEC CHECKSUMS:
TMCache: 95ebcc9b3c7e90fb5fd8fc3036cba3aa781c9bed
UITableView+FDTemplateLayoutCell: 234e1582bcc4e18461af91155123bb96538ed030
PODFILE CHECKSUM:
0c80e9302d494ed154da93823382c933df985f69
PODFILE CHECKSUM:
b9c24bb8fb1ea50b58c59e079b456b4ca1d9b998
COCOAPODS: 1.3.1
GMBase/Classes/OCNavigationBar.m
View file @
ea5e0443
...
...
@@ -45,8 +45,8 @@
make
.
height
.
offset
(
1
/
[
UIScreen
mainScreen
].
scale
);
}];
_itemView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
[
UIApplication
sharedApplication
].
statusBarFrame
.
size
.
height
,
[
UIScreen
mainScreen
].
bounds
.
size
.
width
,
44
)];
CGFloat
titleW
=
[
UIScreen
mainScreen
].
bounds
.
size
.
width
-
8
0
;
_titleLabel
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
4
0
,
0
,
titleW
,
44
)];
CGFloat
titleW
=
[
UIScreen
mainScreen
].
bounds
.
size
.
width
-
50
-
5
0
;
_titleLabel
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
5
0
,
0
,
titleW
,
44
)];
_titleLabel
.
lineBreakMode
=
NSLineBreakByTruncatingMiddle
;
_titleLabel
.
autoresizingMask
=
UIViewAutoresizingFlexibleWidth
|
UIViewAutoresizingFlexibleHeight
;
_titleLabel
.
textAlignment
=
NSTextAlignmentCenter
;
...
...
@@ -95,6 +95,19 @@
button
.
adaptiveWidth
=
40
;
}
-
(
void
)
layoutSubviews
{
[
super
layoutSubviews
];
if
(
_nearRightIcon
||
_nearRightTitle
)
{
_titleLabel
.
frame
=
CGRectMake
(
80
,
0
,
self
.
width
-
160
,
44
);
return
;
}
if
(
_rightTitle
.
length
>=
3
)
{
_titleLabel
.
frame
=
CGRectMake
(
80
,
0
,
self
.
width
-
160
,
44
);
}
}
#pragma mark - Public
-
(
void
)
showShadow
:
(
BOOL
)
show
{
_shadowView
.
hidden
=
!
show
;
...
...
@@ -166,6 +179,7 @@
_rightButton
.
hidden
=
NO
;
[
_rightButton
setImage
:
nil
forState
:
UIControlStateNormal
];
[
_rightButton
setTitle
:
_rightTitle
forState
:
UIControlStateNormal
];
}
-
(
void
)
setNearRightIcon
:
(
NSString
*
)
nearRightIcon
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment