Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
L
LuckFarm
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lmj
LuckFarm
Commits
99f97c44
Commit
99f97c44
authored
Nov 20, 2020
by
zhangshuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加动画
parent
053f2fa1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
2 deletions
+41
-2
GYRankingHeaderView.xib
GYDemo/GYDemo/View/GYRankingHeaderView.xib
+1
-1
BaseViewController.h
GYDemo/GYDemo/ViewController/BaseViewController.h
+8
-0
BaseViewController.m
GYDemo/GYDemo/ViewController/BaseViewController.m
+18
-0
WelfareCenterVC.m
GYDemo/GYDemo/ViewController/Welfare/WelfareCenterVC.m
+14
-1
No files found.
GYDemo/GYDemo/View/GYRankingHeaderView.xib
View file @
99f97c44
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
<view
clipsSubviews=
"YES"
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"LdK-dh-ill"
>
<view
clipsSubviews=
"YES"
contentMode=
"scaleToFill"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"LdK-dh-ill"
>
<rect
key=
"frame"
x=
"10"
y=
"10"
width=
"394"
height=
"55"
/>
<rect
key=
"frame"
x=
"10"
y=
"10"
width=
"394"
height=
"55"
/>
<subviews>
<subviews>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"
钻石
"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"oZ2-Ql-o18"
>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"
可获
"
textAlignment=
"natural"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"oZ2-Ql-o18"
>
<rect
key=
"frame"
x=
"334"
y=
"10"
width=
"60"
height=
"18"
/>
<rect
key=
"frame"
x=
"334"
y=
"10"
width=
"60"
height=
"18"
/>
<constraints>
<constraints>
<constraint
firstAttribute=
"width"
constant=
"60"
id=
"S2N-O7-A1J"
/>
<constraint
firstAttribute=
"width"
constant=
"60"
id=
"S2N-O7-A1J"
/>
...
...
GYDemo/GYDemo/ViewController/BaseViewController.h
View file @
99f97c44
...
@@ -24,6 +24,14 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -24,6 +24,14 @@ NS_ASSUME_NONNULL_BEGIN
//添加右侧按钮
//添加右侧按钮
-
(
void
)
addRightItme
:(
UIImage
*
__nullable
)
image
selecedImage
:(
UIImage
*
__nullable
)
sImage
orText
:(
NSString
*
__nullable
)
text
selectedText
:(
NSString
*
__nullable
)
sText
;
-
(
void
)
addRightItme
:(
UIImage
*
__nullable
)
image
selecedImage
:(
UIImage
*
__nullable
)
sImage
orText
:(
NSString
*
__nullable
)
text
selectedText
:(
NSString
*
__nullable
)
sText
;
-
(
void
)
rightBarButtonItemAction
:(
UIButton
*
)
btn
;
-
(
void
)
rightBarButtonItemAction
:(
UIButton
*
)
btn
;
/// 缩放动画
/// @param toValue 默认为 1.2
/// @param fromValue 默认为 0.8
/// @param key 默认为 transform.scale
+
(
CABasicAnimation
*
)
transformAnimationToValue
:(
NSValue
*
)
toValue
FromValue
:
(
NSValue
*
)
fromValue
withKey
:(
NSString
*
)
key
;
@end
@end
NS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_END
GYDemo/GYDemo/ViewController/BaseViewController.m
View file @
99f97c44
...
@@ -156,4 +156,22 @@
...
@@ -156,4 +156,22 @@
NSLog
(
@"rightButton click"
);
NSLog
(
@"rightButton click"
);
}
}
/// 缩放动画
/// @param toValue 默认为 1.2
/// @param fromValue 默认为 0.8
/// @param key 默认为 transform.scale
+
(
CABasicAnimation
*
)
transformAnimationToValue
:
(
NSValue
*
)
toValue
FromValue
:
(
NSValue
*
)
fromValue
withKey
:
(
NSString
*
)
key
;{
CABasicAnimation
*
animation
=
[[
CABasicAnimation
alloc
]
init
];
animation
.
duration
=
0
.
5
;
animation
.
fromValue
=
@
(
0
.
8
);
animation
.
toValue
=
@
(
1
.
2
);
animation
.
byValue
=
@
(
3
);
animation
.
timingFunction
=
[
CAMediaTimingFunction
functionWithName
:
kCAMediaTimingFunctionEaseIn
];
animation
.
autoreverses
=
YES
;
animation
.
repeatCount
=
MAXFLOAT
;
return
animation
;
}
@end
@end
GYDemo/GYDemo/ViewController/Welfare/WelfareCenterVC.m
View file @
99f97c44
...
@@ -57,7 +57,7 @@
...
@@ -57,7 +57,7 @@
}
}
-
(
void
)
viewDidLoad
{
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
[
super
viewDidLoad
];
[
self
addLeftItme
:[
UIImage
imageNamed
:
@"arrow_left"
]
selecedImage
:
nil
orText
:
@" "
selectedText
:
nil
];
[
self
addLeftItme
:[
UIImage
imageNamed
:
@"arrow_left"
]
selecedImage
:
nil
orText
:
@"
"
selectedText
:
nil
];
self
.
title
=
@"福利中心"
;
self
.
title
=
@"福利中心"
;
[
self
loadData
];
[
self
loadData
];
[
self
initTableView
];
[
self
initTableView
];
...
@@ -239,8 +239,21 @@
...
@@ -239,8 +239,21 @@
if
(
self
.
coinsProcess
>=
6
)
{
if
(
self
.
coinsProcess
>=
6
)
{
[
self
.
treasureBox
setImage
:[
UIImage
imageNamed
:
@"OpenTreasureChest"
]
forState
:
UIControlStateNormal
];
[
self
.
treasureBox
setImage
:[
UIImage
imageNamed
:
@"OpenTreasureChest"
]
forState
:
UIControlStateNormal
];
CABasicAnimation
*
animation
=
[[
CABasicAnimation
alloc
]
init
];
animation
.
duration
=
0
.
5
;
animation
.
fromValue
=
@
(
0
.
8
);
animation
.
toValue
=
@
(
1
.
2
);
animation
.
byValue
=
@
(
3
);
animation
.
timingFunction
=
[
CAMediaTimingFunction
functionWithName
:
kCAMediaTimingFunctionEaseIn
];
animation
.
autoreverses
=
YES
;
animation
.
repeatCount
=
MAXFLOAT
;
// transform.scale
[
self
.
treasureBox
.
layer
addAnimation
:
animation
forKey
:
@"transform.scale"
];
}
else
{
}
else
{
[
self
.
treasureBox
setImage
:[
UIImage
imageNamed
:
@"TreasureChestClose"
]
forState
:
UIControlStateNormal
];
[
self
.
treasureBox
setImage
:[
UIImage
imageNamed
:
@"TreasureChestClose"
]
forState
:
UIControlStateNormal
];
[
self
.
treasureBox
.
layer
removeAnimationForKey
:
@"transform.scale"
];
}
}
self
.
currentText
.
text
=
[
NSString
stringWithFormat
:
@"%ld"
,
self
.
coinsProcess
];
self
.
currentText
.
text
=
[
NSString
stringWithFormat
:
@"%ld"
,
self
.
coinsProcess
];
...
...
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