У меня есть ScrollView, который назначается по горизонтали в собственном приложении React. Я пробовал почти все решения по переполнению стека, но ни одно из них не сработало. Я использую родную базу. Я удалил лишний эскиз для ясности кода. Эскизу назначается горизонтальное, но прокрутки нет. Я также использую библиотеку response-native-swiper.
import React from "react";
import { View, ScrollView } from "react-native";
import {
Container,
Header,
Content,
List,
ListItem,
Left,
Body,
Right,
Thumbnail,
Text,
Icon,
Input,
Item,
} from "native-base";
import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityIcons";
const StoriesComponent = () => {
return (
<Container>
<Header
searchBar
rounded
style={{
position: "relative",
backgroundColor: "white",
left: 0,
right: 0,
top: 0,
alignItems: "center",
elevation: 0, // for android
}}
>
<View style={{ flexDirection: "row", flex: 11, marginLeft: 5 }}>
<Item
style={{
backgroundColor: "#ccc",
borderRadius: 35,
borderWidth: 1,
borderColor: "white",
marginLeft: 10,
}}
>
<Icon name="md-search" style={{ color: "black" }} />
<Input placeholder="Search" placeholderTextColor="black" />
</Item>
</View>
<View
style={{
flexDirection: "row",
flex: 2,
justifyContent: "space-around",
}}
>
<MaterialCommunityIcons
name="dots-horizontal"
style={{ color: "black", fontSize: 26 }}
/>
</View>
</Header>
<Content>
<View style={{ height: 100 }}>
<View style={{ flex: 1, paddingLeft: 7 }}>
<Text>Stories</Text>
</View>
<View style={{ flex: 3 }}>
<ScrollView
horizontal={true}
showsHorizontalScrollIndicator={false}
contentContainerStyle={{
alignItems: "center",
paddingStart: 5,
paddingEnd: 5,
}}
>
<Thumbnail
source={{
uri:
"https://s3.amazonaws.com/uifaces/faces/twitter/ladylexy/128.jpg",
}}
style={{
marginHorizontal: 5,
borderColor: "purple",
borderWidth: 2,
}}
/>
</ScrollView>
</View>
</View>
</Content>
</Container>
);
};
export default StoriesComponent;