Skip to content

Commit

Permalink
* [ios] fix bug height change to zero when style change
Browse files Browse the repository at this point in the history
  • Loading branch information
kfeagle committed Nov 29, 2016
1 parent a4d7ebe commit 1ed428d
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 5 deletions.
76 changes: 72 additions & 4 deletions examples/hello.we
@@ -1,5 +1,73 @@
<template>
<div>
<text style="font-size:100px;">Hello World.</text>
</div>
</template>
<scroller style="flex-direction: column; background-color: #ffffff;width:750;height:1000;border-width: 3;border-color: #00ff00;">
<TC_Support_MainTitle title="TC_DataBind_DefaultClass"></TC_Support_MainTitle>

<TC_Support_SubTitle title="Default"></TC_Support_SubTitle>
<div class="content">
<text style="color:#000000; font-size:{{defaultFont}}">Hello weex!</text>
</div>

<TC_Support_SubTitle title="Content"></TC_Support_SubTitle>
<div class="content">
<text class="{{contentStyle}}">Hello weex!</text>
</div>

<TC_Support_SubTitle title="Change"></TC_Support_SubTitle>
<div class="button" onclick="multiStyle">
<text class="text">Multi style</text>
</div>
<div class="button" onclick="defaultStyle">
<text class="text">Default style</text>
</div>

</scroller>
</template>

<style>
.button {
width:400;
height:50;
background-color:#EEEEEE;
justify-content: center;
margin:20;
}
.text {
font-size:20;
text-align: center;
}
.content {
width:400;
height:100;
background-color:#EEEEEE;
margin-left:20;
}
.multi-style {
border-width:3;
border-style:solid;
border-color:#FFFF00;
border-radius:10;
font-size:60;
color:#FF0000;
background-color:#00F0FF;
}
.default-style {
height:100;
}
</style>

<script>
module.exports = {
data: {
defaultFont:'',
contentStyle: 'multi-style'
},
methods: {
multiStyle:function (e) {
this.contentStyle = 'multi-style'
},
defaultStyle:function (e) {
this.contentStyle = 'default-style'
},
}
}
</script>
1 change: 0 additions & 1 deletion ios/sdk/WeexSDK/Sources/Manager/WXComponentManager.m
Expand Up @@ -358,7 +358,6 @@ - (void)updateStyles:(NSDictionary *)styles forComponent:(NSString *)ref
WXAssertComponentExist(component);

NSDictionary *normalStyles = [self fetchStyles:styles];
normalStyles = @{};
NSDictionary *resetStyles = [self fetchResetStyles:styles];
[component _updateStylesOnComponentThread:normalStyles resetStyles:resetStyles];
[self _addUITask:^{
Expand Down

0 comments on commit 1ed428d

Please sign in to comment.