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
5f3af423
Commit
5f3af423
authored
Jan 30, 2018
by
汪洋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化layoutTitle
parent
19635a20
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
OCNavigationBar.m
GMBase/Classes/OCNavigationBar.m
+10
-0
No files found.
GMBase/Classes/OCNavigationBar.m
View file @
5f3af423
...
...
@@ -97,7 +97,13 @@
-
(
void
)
layoutSubviews
{
[
super
layoutSubviews
];
[
self
layoutTitle
];
}
/**
限制标题视图的大小,不会盖住右边的button
*/
-
(
void
)
layoutTitle
{
if
(
_nearRightIcon
||
_nearRightTitle
)
{
_titleLabel
.
frame
=
CGRectMake
(
80
,
0
,
self
.
width
-
160
,
44
);
return
;
...
...
@@ -165,6 +171,7 @@
_rightIcon
=
rightIcon
;
_rightButton
.
hidden
=
NO
;
[
_rightButton
setImage
:[
UIImage
imageNamed
:
_rightIcon
]
forState
:
UIControlStateNormal
];
[
self
layoutTitle
];
}
-
(
void
)
setLeftTitle
:
(
NSString
*
)
leftTitle
{
...
...
@@ -179,12 +186,14 @@
_rightButton
.
hidden
=
NO
;
[
_rightButton
setImage
:
nil
forState
:
UIControlStateNormal
];
[
_rightButton
setTitle
:
_rightTitle
forState
:
UIControlStateNormal
];
[
self
layoutTitle
];
}
-
(
void
)
setNearRightIcon
:
(
NSString
*
)
nearRightIcon
{
_nearRightIcon
=
nearRightIcon
;
_nearRightButton
.
hidden
=
NO
;
[
_nearRightButton
setImage
:[
UIImage
imageNamed
:
_nearRightIcon
]
forState
:
UIControlStateNormal
];
[
self
layoutTitle
];
}
-
(
void
)
setNearRightTitle
:
(
NSString
*
)
nearRightTitle
{
...
...
@@ -192,6 +201,7 @@
_nearRightButton
.
hidden
=
NO
;
[
_nearRightButton
setImage
:
nil
forState
:
UIControlStateNormal
];
[
_nearRightButton
setTitle
:
_nearRightTitle
forState
:
UIControlStateNormal
];
[
self
layoutTitle
];
}
@end
...
...
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