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
78957ca0
Commit
78957ca0
authored
Sep 12, 2018
by
jinzhu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
外漏 OCNavigationBar 间距
parent
1ce940fd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
7 deletions
+22
-7
Podfile.lock
Example/Podfile.lock
+2
-2
OCNavigationBar.h
GMBase/Classes/OCNavigationBar.h
+5
-0
OCNavigationBar.m
GMBase/Classes/OCNavigationBar.m
+15
-5
No files found.
Example/Podfile.lock
View file @
78957ca0
...
...
@@ -14,7 +14,7 @@ PODS:
- AFNetworking/Serialization (3.1.0)
- AFNetworking/UIKit (3.1.0):
- AFNetworking/NSURLSession
- GMBase (0.4.
3
):
- GMBase (0.4.
4
):
- GMHud
- GMJSONModel
- GMKit
...
...
@@ -103,7 +103,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
GMBase:
11e3302fcb7fc304469fc7e123f6961c318b7793
GMBase:
f4e70f9df40fe5bf714ad46f9417466d4be060a4
GMCache: b7d48432ee2469eb0c6c86c720a1958bd373187e
GMHud: 9cc3942fc9f215db55b134cbfd05a458b124a964
GMJSONModel: 5e81a98de668e9f93cf6ff77869f77b0d1a806be
...
...
GMBase/Classes/OCNavigationBar.h
View file @
78957ca0
...
...
@@ -36,6 +36,11 @@ NS_ASSUME_NONNULL_BEGIN
@property
(
nonatomic
,
strong
,
readonly
)
OCNavigationBarButton
*
rightButton
;
@property
(
nonatomic
,
strong
,
readonly
)
OCNavigationBarButton
*
nearRightButton
;
/**
* 设置导航栏 leftButton rightButton nearRightButton 外间距(目前来看这三个间距应该是一样的 如果不一样可以找设计协商)
* 间距 主要用作button带一个圆形背景导航栏渐变默认统一为10
*/
@property
(
nonatomic
,
assign
)
CGFloat
buttonMargin
;
/**
leftIcon 有默认值:back
*/
...
...
GMBase/Classes/OCNavigationBar.m
View file @
78957ca0
...
...
@@ -30,6 +30,7 @@
-
(
void
)
awakeFromNib
{
[
super
awakeFromNib
];
_buttonMargin
=
20
;
[
self
setup
];
}
...
...
@@ -37,7 +38,7 @@
self
.
clipsToBounds
=
NO
;
self
.
backgroundColor
=
[
UIColor
whiteColor
];
[
self
addNavigationShadow
];
_itemView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
[
UIScreen
mainScreen
].
bounds
.
size
.
width
,
44
)];
CGFloat
titleW
=
[
UIScreen
mainScreen
].
bounds
.
size
.
width
-
80
;
_titleLabel
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
40
,
0
,
titleW
,
44
)];
...
...
@@ -67,19 +68,23 @@
[
_itemView
addSubview
:
_leftButton
];
[
_itemView
addSubview
:
_rightButton
];
[
_itemView
addSubview
:
_nearRightButton
];
[
_itemView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
[
self
updateButtonsConstraints
];
}
-
(
void
)
updateButtonsConstraints
{
[
_itemView
mas_remakeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
right
.
bottom
.
mas_equalTo
(
0
);
make
.
height
.
mas_equalTo
(
44
);
}];
[
_leftButton
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
[
_leftButton
mas_
re
makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
mas_equalTo
(
20
);
make
.
centerY
.
mas_equalTo
(
0
);
}];
[
_rightButton
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
[
_rightButton
mas_
re
makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
right
.
mas_equalTo
(
-
20
);
make
.
centerY
.
mas_equalTo
(
0
);
}];
[
_nearRightButton
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
[
_nearRightButton
mas_
re
makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
right
.
equalTo
(
_rightButton
.
mas_left
).
offset
(
-
20
);
make
.
centerY
.
mas_equalTo
(
0
);
}];
...
...
@@ -225,6 +230,11 @@
[
self
layoutTitle
];
}
-
(
void
)
setButtonMargin
:
(
CGFloat
)
buttonMargin
{
_buttonMargin
=
buttonMargin
;
[
self
updateButtonsConstraints
];
}
@end
@implementation
OCNavigationBar
(
ViewConstant
)
...
...
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