Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dnrops
AnimatedCollectionViewLayout
提交
cb87d1e4
A
AnimatedCollectionViewLayout
项目概览
dnrops
/
AnimatedCollectionViewLayout
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
AnimatedCollectionViewLayout
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cb87d1e4
编写于
4月 05, 2019
作者:
J
Jin Wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Demonstrated how to make element laid out differently to achieve different parallex effect.
上级
4161cac4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
42 addition
and
12 deletion
+42
-12
iOS Example/Source/Base.lproj/Main.storyboard
iOS Example/Source/Base.lproj/Main.storyboard
+10
-11
iOS Example/Source/ImageCollectionViewController.swift
iOS Example/Source/ImageCollectionViewController.swift
+32
-1
未找到文件。
iOS Example/Source/Base.lproj/Main.storyboard
浏览文件 @
cb87d1e4
<?xml version="1.0" encoding="UTF-8"?>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB"
version=
"3.0"
toolsVersion=
"14
313.18
"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
colorMatched=
"YES"
initialViewController=
"NbP-BS-4jY"
>
<document
type=
"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB"
version=
"3.0"
toolsVersion=
"14
490.70
"
targetRuntime=
"iOS.CocoaTouch"
propertyAccessControl=
"none"
useAutolayout=
"YES"
useTraitCollections=
"YES"
colorMatched=
"YES"
initialViewController=
"NbP-BS-4jY"
>
<device
id=
"retina4_7"
orientation=
"portrait"
>
<adaptation
id=
"fullscreen"
/>
</device>
<dependencies>
<deployment
identifier=
"iOS"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"14
283.14
"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"14
490.49
"
/>
<capability
name=
"documents saved in the Xcode 8 format"
minToolsVersion=
"8.0"
/>
</dependencies>
<scenes>
...
...
@@ -32,21 +32,20 @@
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"200"
height=
"200"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<subviews>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"Label"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"QSQ-Xq-WAm"
>
<rect
key=
"frame"
x=
"-9"
y=
"38.5"
width=
"218"
height=
"123"
/>
<fontDescription
key=
"fontDescription"
name=
"AvenirNext-UltraLight"
family=
"Avenir Next"
pointSize=
"90"
/>
<color
key=
"textColor"
white=
"1"
alpha=
"1"
colorSpace=
"calibratedWhite"
/>
<nil
key=
"highlightedColor"
/>
</label>
<imageView
clipsSubviews=
"YES"
userInteractionEnabled=
"NO"
contentMode=
"scaleAspectFit"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"8gI-El-CPc"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"200"
height=
"200"
/>
</imageView>
</subviews>
</view>
<constraints>
<constraint
firstItem=
"QSQ-Xq-WAm"
firstAttribute=
"centerX"
secondItem=
"PaF-XJ-Xcy"
secondAttribute=
"centerX"
id=
"9ef-xY-PkK"
/>
<constraint
firstItem=
"QSQ-Xq-WAm"
firstAttribute=
"centerY"
secondItem=
"PaF-XJ-Xcy"
secondAttribute=
"centerY"
id=
"Ka3-TZ-Uga"
/>
<constraint
firstAttribute=
"bottom"
secondItem=
"8gI-El-CPc"
secondAttribute=
"bottom"
id=
"NcH-gu-whz"
/>
<constraint
firstAttribute=
"trailing"
secondItem=
"8gI-El-CPc"
secondAttribute=
"trailing"
id=
"VRy-0w-Fbr"
/>
<constraint
firstItem=
"8gI-El-CPc"
firstAttribute=
"leading"
secondItem=
"PaF-XJ-Xcy"
secondAttribute=
"leading"
id=
"ZKn-R6-Jer"
/>
<constraint
firstItem=
"8gI-El-CPc"
firstAttribute=
"top"
secondItem=
"PaF-XJ-Xcy"
secondAttribute=
"top"
id=
"osF-Kr-Lhp"
/>
</constraints>
<size
key=
"customSize"
width=
"200"
height=
"200"
/>
<connections>
<outlet
property=
"
titleLabel"
destination=
"QSQ-Xq-WAm"
id=
"8Vm-ea-2IG
"
/>
<outlet
property=
"
imageView"
destination=
"8gI-El-CPc"
id=
"OY3-mP-zo6
"
/>
</connections>
</collectionViewCell>
</cells>
...
...
iOS Example/Source/ImageCollectionViewController.swift
浏览文件 @
cb87d1e4
...
...
@@ -11,11 +11,42 @@ import AnimatedCollectionViewLayout
class
SimpleCollectionViewCell
:
UICollectionViewCell
{
@IBOutlet
weak
var
titleLabel
:
UILabel
!
// @IBOutlet weak var titleLabel: UILabel!
@IBOutlet
private
var
imageView
:
UIImageView
!
private
let
titleLabel
=
UILabel
(
frame
:
.
zero
)
override
func
awakeFromNib
()
{
super
.
awakeFromNib
()
backgroundColor
=
.
clear
addSubview
(
titleLabel
)
let
horizontalCenterConstraint
=
NSLayoutConstraint
(
item
:
titleLabel
,
attribute
:
.
centerX
,
relatedBy
:
.
equal
,
toItem
:
self
,
attribute
:
.
centerX
,
multiplier
:
1.0
,
constant
:
0
)
let
verticalCenterConstraint
=
NSLayoutConstraint
(
item
:
titleLabel
,
attribute
:
.
centerY
,
relatedBy
:
.
equal
,
toItem
:
self
,
attribute
:
.
centerY
,
multiplier
:
1.0
,
constant
:
0
)
addConstraint
(
horizontalCenterConstraint
)
addConstraint
(
verticalCenterConstraint
)
titleLabel
.
translatesAutoresizingMaskIntoConstraints
=
false
titleLabel
.
font
=
.
preferredFont
(
forTextStyle
:
.
headline
)
titleLabel
.
textColor
=
.
white
imageView
.
contentMode
=
.
scaleAspectFill
imageView
.
image
=
#
imageLiteral
(
resourceName
:
"nature3"
)
}
func
bind
(
color
:
String
,
imageName
:
String
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录