Closed
Description
Is this a bug report?
(YES/No)
Have you read the Contributing Guidelines?
(YES)
Environment
react-native -v
:0.46.4node -v
:v8.3.0npm -v
:5.3.0yarn --version
:0.27.5
Then, specify:
- Target Platform: android && ios
- Development Operating System: mac10.12.5
- Build tools:webstorm
Steps to Reproduce
code like that:
renderTab = ()=> {
return (
<View style={{width:WIDTH,height:SCALE(100),backgroundColor:'blue',flexDirection:'row', justifyContent:'space-around', alignItems:'center'}}>
<View><Text>我发起的</Text></View>
{(this.state.data&&this.state.data.myIsLeader===1)?<View><Text>带我审批</Text></View>:null}
{(this.state.data&&this.state.data.myIsLeader===1)?<View><Text>我已审批</Text></View>:null}
</View>)
};
render(){
return (
<View style={{width:WIDTH,height:HEIGHT}}>
<ScrollView
style={{backgroundColor:'red',width:WIDTH,height:HEIGHT-SCALE(200)}}>
</ScrollView>
{this.renderTab()}
</View>
);
}
if I delet style={{width:WIDTH,height:HEIGHT}} or I set style={{flex:1}} will be ok.
Why?
Expected Behavior
Actual Behavior
Reproducible Demo
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
Ehesp commentedon Aug 21, 2017
chirag04 commentedon Aug 21, 2017
use contentContainerStyle prop of scrollview.
chirag04 commentedon Aug 21, 2017
@facebook-github-bot stack-overflow
facebook-github-bot commentedon Aug 21, 2017
Hey @wuyunqiang, thanks for posting this! @chirag04 tells me this issue looks like a question that would be best asked on Stack Overflow. Stack Overflow is amazing for Q&A: it has a reputation system, voting, the ability to mark a question as answered. Because of the reputation system it is likely the community will see and answer your question there. This also helps us use the GitHub bug tracker for bugs only. See "What to Expect from Maintainers".