Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css ScrollView不是滚动视图_Css_Reactjs_React Native - Fatal编程技术网

Css ScrollView不是滚动视图

Css ScrollView不是滚动视图,css,reactjs,react-native,Css,Reactjs,React Native,由于某些原因,我的滚动视图在模拟器中无法工作。正在渲染反馈卡,但它们没有滚动。当我用环绕反馈卡时,它们从垂直中心移动到屏幕顶部,因此它正在做一些事情。只是不允许滚动 import React, { Component } from 'react'; import styled from 'styled-components/native'; import FeedCard from '../components/FeedCards/FeedCard'; const Root = styled

由于某些原因,我的滚动视图在模拟器中无法工作。正在渲染反馈卡,但它们没有滚动。当我用
环绕反馈卡时,它们从垂直中心移动到屏幕顶部,因此它正在做一些事情。只是不允许滚动

import React, { Component } from 'react';
import styled from 'styled-components/native';

import FeedCard from '../components/FeedCards/FeedCard';

const Root = styled.View`
  flex: 1;
  justifyContent: center;
  backgroundColor: #f2f2f2;
  paddingTop: 5;
`;

const List = styled.ScrollView`
  flex: 1;
`;

class HomeScreen extends Component {
  state = { }
  render() {
    return (
    <Root>
        <List>
          <FeedCard />
          <FeedCard />
        </List>
    </Root>
    );
  }
}

export default HomeScreen;
import React,{Component}来自'React';
从“样式化组件/本机”导入样式化;
从“../components/FeedCards/FeedCard”导入FeedCard;
const Root=styled.View`
弹性:1;
论证内容:中心;
背景颜色:#f2f2;
填料:5;
`;
const List=styled.ScrollView`
弹性:1;
`;
类主屏幕扩展组件{
状态={}
render(){
返回(
);
}
}
导出默认主屏幕;
怎么了

ScrollView仅在渲染元素的数量进入设备宽度/高度时工作。如果您使用的是Ios仿真器,滚动条应该解锁,但在Android仿真器中,只需通过大小即可