简体   繁体   English

嗨,我是 React Native 的新手,使用 Native-base 我正在尝试设计卡片视图

[英]Hi i am new to React Native, Using Native-base I am trying to design Card View

视图会这样 enter image description here ][2][,[I am facing problem here inside the Card, able to see description part i am trying to implement its coming below the image actually it suppose to come beside the image `在此处输入图像描述][2][,[我在卡内遇到问题,能够看到描述部分我正在尝试实现它位于图像下方,实际上它应该位于图像旁边`

<ListItem>
                  <Card
                    style={{
                      marginTop: 0,
                      marginBottom: 0,
                      marginRight: 0,
                      marginLeft: 0,
                      borderTopLeftRadius: 8,
                      borderTopRightRadius: 8,
                      flexDirection: 'row',
                    }}>
                     <View style={{flex: 1}}>
                          <CardItem>
                            <Thumbnail
                              source={require('../../assets/images/restaurant_128.png')}
                            />
                          </CardItem>
                        </View>
                        <View style={{flex: 3, flexDirection: 'column'}}>
                          <CardItem>
                            <Body>
                              <Text>{item.Title}</Text>
                              <Text style={{backgroundColor: 'green'}}>
                                {item.Description}
                              </Text>
                            </Body>
                          </CardItem>
                        </View
                      </Card>
                    </ListItem>

` `

try this:-尝试这个:-

                    <View style={{
                        flexDirection: "row",
                        justifyContent: "flex-start",
                        alignItems: "center",
                        backgroundColor: "#B8B2B2",
                        width: "100%",
                        height: 100
                    }}>
                        <View style={{
                            width: "30%",
                            backgroundColor: "red",
                            height: 100
                        }}>
                            <Text>left image here</Text>
                        </View>
                        <View style={{
                            width: "70%",
                            backgroundColor: "#B8B2B2",
                            height: 100
                        }}>
                            <View style={{
                                flexDirection: "row",
                                justifyContent: "space-between",
                                alignItems: "center",
                                backgroundColor: "#fff",
                                height: 50
                            }}>
                                <View style={{
                                    width: "30%",
                                    backgroundColor: "teal",
                                    height: 50
                                }}>
                                    <Text>lamb samosa</Text>
                                </View>
                                <View style={{
                                    width: "30%",
                                    backgroundColor: "teal",
                                    height: 50
                                }}>
                                    <Text>$4.5</Text>
                                </View>
                            </View>
                            <View style={{
                                width: "100%",
                                backgroundColor: "#B8B2B2",
                                height: 50
                            }}>
                                <Text>Lorem Ipsum</Text>
                            </View>
                        </View>
                    </View>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 base64 加密在 react-native 中加密密码,我是 react-native 的新手 - how do i encrypt the password in react-native using base64 encryption ,i am new to react-native zIndex doot可在本机卡上运行-反应本机 - zIndex doesot work on Card of native-base - react native 我正在创建一个 React 本机 Web 视图 - I am creating a React native web view 我无法下载 native-base - I cant download native-base 我是否将ATS与React Native Firebase一起使用? - Am i using ATS with React Native Firebase? 标题标题未使用 native-base 在 React Native 中居中 - Header Title not centered in React Native using native-base 我在我的 React Native 应用程序中使用 react-native-camera 进行视频录制。 我想用它显示计时器。 我是 React Native 的新手 - I am using react-native-camera for video recording in my React Native App. I want to show timer with it. I am new to React Native 响应Native Native的优势? - React Native native-base's advantages? 为什么我在react-native项目中无法使用npm安装native-base? - Why i can't install native-base with npm in my react-native project? 我在使用 Mac OS high sierra 尝试创建新的 React Native 项目时安装捆绑器时遇到问题 - I got a problem installing bundler when trying create my new react native project am using Mac OS high sierra
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM