scrollView 宽高无效
来源:互联网 发布:防sql注入最佳 编辑:程序博客网 时间:2024/05/20 03:45
Environment
react-native -v
:0.46.4node -v
:v8.3.0npm -v
:5.3.0yarn --version
:0.27.5- 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> ); }
期望效果
like that:
实际效果
解决:
删除 style={{width:WIDTH,height:HEIGHT}}
或者设置style={{flex:1}} 。
scrollview的属性不光和自己有关还和父组件栈的属性有关。
GitHub:https://github.com/facebook/react-native/issues/15581
阅读全文
0 0
- scrollView 宽高无效
- scrollView.scrollTo无效
- ScrollView中smoothScrollTo()方法无效
- ImgeView通过加载布局,addview宽高无效问题
- 【解决方案】CSS 给 label 设置宽高无效
- Popwindow 设置宽高无效的原因和解决方案
- RecyclerView Item 布局宽高无效问题探究
- RecyclerView Item 布局宽高无效问题探究
- RecyclerView Item 布局宽高无效问题探究
- RecyclerView Item 布局宽高无效问题探究
- ScrollView中smoothScrollTo无效的解决办法
- ScrollView下子控件设置fill_parent无效
- ScrollView子控件高度设置无效
- 解决ScrollView ScrollTo方法无效的方法
- ScrollView的子View高度match_parent无效
- ScrollView在SlidingUpPanelLayout中下滑无效问题
- 解决scrollview与listview共存问题 计算listview的宽高(item中有imageview)
- swift 高清截图 ScrollView截图
- Expedition
- Date、Calender和SimpleDateFormat类
- 知识点:CSS实现一个图案
- 指针
- Flask-处理客户端通过POST方法传送的数据
- scrollView 宽高无效
- Myeclipse jax-ws框架实现简单的webservice服务器端与客户端
- AAA
- 带权并查集 then
- ZooKeeper(2)-基本介绍
- HDU 6105 Gameia(博弈+二分匹配)
- Aptana插件安装以及配置
- Android Studio集成到Genymotion模拟器
- linux中为tomcat配置虚拟路径来作为视频播放器