Skip to content

Commit 128fb6e

Browse files
author
Michael Johnston
committed
Fix css-layout example.
Fixes Flipboard#43.
1 parent f20e5e0 commit 128fb6e

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

examples/css-layout/app.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ var App = React.createClass({
2323
<Text style={this.getTitleStyle()}>
2424
Professor PuddinPop
2525
</Text>
26-
<Image src='http://lorempixel.com/360/420/cats/1/' style={this.getImageStyle()} fadeIn={true} />
26+
<Group style={this.getImageGroupStyle()}>
27+
<Image src='http://lorempixel.com/360/420/cats/1/' style={this.getImageStyle()} fadeIn={true} />
28+
</Group>
2729
<Text style={this.getExcerptStyle()}>
2830
With these words the Witch fell down in a brown, melted, shapeless mass and began to spread over the clean boards of the kitchen floor. Seeing that she had really melted away to nothing, Dorothy drew another bucket of water and threw it over the mess. She then swept it all out the door. After picking out the silver shoe, which was all that was left of the old woman, she cleaned and dried it with a cloth, and put it on her foot again. Then, being at last free to do as she chose, she ran out to the courtyard to tell the Lion that the Wicked Witch of the West had come to an end, and that they were no longer prisoners in a strange land.
2931
</Text>
@@ -51,13 +53,24 @@ var App = React.createClass({
5153
};
5254
},
5355

54-
getImageStyle: function () {
56+
getImageGroupStyle: function () {
5557
return {
58+
position: 'relative',
5659
flex: 1,
5760
backgroundColor: '#eee'
5861
};
5962
},
6063

64+
getImageStyle: function () {
65+
return {
66+
position: 'absolute',
67+
left: 0,
68+
top: 0,
69+
right: 0,
70+
bottom: 0
71+
};
72+
},
73+
6174
getTitleStyle: function () {
6275
return {
6376
fontFace: FontFace('Georgia'),

0 commit comments

Comments
 (0)