Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ios
/
Masonry
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
0oneo
11 years ago
Commit
cc4c436e40c0b161a55d274cea7a899ef4c57d6a
1 parent
9ab610a0
make UIScrollView demo more self-explanation
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
Examples/Masonry iOS Examples/MASExampleScrollView.m
Examples/Masonry iOS Examples/MASExampleScrollView.m
View file @
cc4c436
...
...
@@ -39,8 +39,10 @@
UIView
*
contentView
=
UIView
.
new
;
[
self
.
scrollView
addSubview
:
contentView
];
[
contentView
makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
edges
.
equalTo
(
self
.
scrollView
)
;
make
.
width
.
equalTo
(
self
.
scrollView
.
width
)
;
make
.
edges
.
equalTo
(
self
.
scrollView
)
;
// let the UIScrollView knonw where the edge is the contentView
// the size of UIScrollView's contentView must be able to caculated by the constraints. here set the width;
// the height will be set bellow.
make
.
width
.
equalTo
(
self
.
width
)
;
}];
UIView
*
lastView
;
...
...
@@ -65,15 +67,11 @@
height
+=
25
;
lastView
=
view
;
}
// dummy view, which determines the size of the contentView size and therefore the scrollView contentSize
UIView
*
sizingView
=
UIView
.
new
;
[
scrollView
addSubview
:
sizingView
];
[
sizingView
makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
top
.
equalTo
(
lastView
.
bottom
)
;
make
.
bottom
.
equalTo
(
contentView
.
bottom
)
;
}];
[
contentView
makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
bottom
.
equalTo
(
lastView
.
bottom
)
;
}];
return
self
;
}
...
...
Please
register
or
login
to post a comment