React-Native -课后练习

import React, { Component } from ‘react‘;
import {
  AppRegistry,
  StyleSheet,
  Text,
  View,
  Image,
} from ‘react-native‘;

class meituan extends Component {
  render() {
    return (

        <View>
      <View style={[styles.view_row,styles.height_160]}>
          <View style={[styles.height_160,styles.partLeft]}>
              <Text style={[styles.marginTextTop_18,styles.grendTextFontSize]}>我们约吧</Text>
              <Text style={[styles.marginTextTop_14,styles.textfontSize_10,{textAlign:‘center‘}]}>恋人家人好朋友</Text>
              <Image style={[styles.yueba_height,styles.marginTextTop_14]} source={{uri:‘http://ww4.sinaimg.cn/mw690/6b2243e8gw1f71tzeulkpj20f00k00ve.jpg‘}}></Image>
          </View>
          <View style={[styles.height_160,styles.partRgith]}>
              <View style={[styles.view_row,{flex:1}]}>
                  <View style={{flex:1}}>
                  <Text style={[styles.textfontSize_14,styles.red_font,styles.textfontSize_14,{marginLeft:30}]}>低价超值</Text>
                  <Text style={[styles.textfontSize_10,styles.textfontSize_14,{marginTop:14,marginLeft:30}]}>十元惠生活</Text>
                  </View>
                  <View style={[{flex:1},{marginTop:-10,marginLeft:10}]}>
                      <Image style={styles.hanbaoImage} source={{uri:‘http://ww4.sinaimg.cn/mw690/005Ge4Xjjw1f6nttg4srgj316o1kwhdt.jpg‘}}></Image>
                  </View>
              </View>
                  <View style={{flex:1,flexDirection:‘row‘,borderWidth:0.5,borderColor:‘red‘}}>
                      <View style={{flex:1}}>
                          <Text style={[styles.textfontSize_14,styles.red_font,{marginLeft:10,marginTop:8}]}>聚会邀请</Text>
                          <Text style={[styles.textfontSize_10,{marginLeft:10,marginTop:8}]}>朋友家人常聚餐</Text>
                          <Image style={[styles.hongshaorouImage,{alignSelf:‘center‘}]} source={{uri:‘http://ww2.sinaimg.cn/mw690/6b2243e8gw1f79z2o5rakj20qp0snn22.jpg‘}}></Image>
                      </View>
                      <View style={{flex:1}}>
                          <Text style={[styles.textfontSize_14,styles.blue_font,{marginLeft:10,marginTop:8}]}>名店抢购</Text>
                          <Text style={[styles.textfontSize_10,{marginLeft:10,marginTop:8}]}>距离结束</Text>
                          <Text style={[styles.textfontSize_10,{marginLeft:10,marginTop:8}]}>12:20:30</Text>
                      </View>
                  </View>
          </View>
      </View>
            <View>
                <View style={{backgroundColor:‘#FF00FF‘,height:8,marginTop:20}}></View>
                <View style={{borderWidth:0.5,borderColor:‘blue‘,height:65,flexDirection:‘row‘}}>
                    <View style={{flex:1}}>
                        <Text style={{color:‘red‘,fontSize:18,marginLeft:15,marginTop:10}}>一元吃大餐</Text>
                        <Text style={{color:‘blue‘,fontSize:12,marginLeft:15,marginTop:10}}>新用户专享</Text>
                    </View>
                    <View style={{flex:1}}>
                        <Image style={{height:50,width:120,marginTop:7.5,alignSelf:‘flex-end‘,marginRight:10}} source={{uri:‘http://ww2.sinaimg.cn/mw690/006uhw44gw1f7c4d3as1qj31hc1z4txo.jpg‘}}></Image>
                    </View>
                </View>

                <View>
                    <View style={{flexDirection:‘row‘,borderBottomWidth:1,borderColor:‘red‘}}>
                        <View style={{flex:1,borderColor:‘green‘,borderRightWidth:1,flexDirection:‘row‘}}>
                            <View style={{flex:1}}>
                                <Text style={{fontSize:14,color:‘red‘}}>撸串节狂欢</Text>
                                <Text style={{fontSize:12}}>烤串6.6元起</Text>
                            </View>
                            <View style={{flex:1}}>
                                <Image style={styles.hanbaoImage} source={{uri:‘http://ww1.sinaimg.cn/mw690/0068LYwcgw1f7bn60viq3j30f00k1mz6.jpg‘}}></Image>
                            </View>
                        </View>

                        <View style={{flex:1,flexDirection:‘row‘}}>
                            <View style={{flex:1}}>
                                <Text style={{fontSize:14,color:‘red‘}}>撸串节狂欢</Text>
                                <Text style={{fontSize:12}}>烤串6.6元起</Text>
                            </View>
                            <View style={{flex:1}}>
                                <Image style={styles.hanbaoImage} source={{uri:‘http://ww2.sinaimg.cn/mw690/87a5d32cgw1f79yc94vv7j20ku1127a3.jpg‘}}></Image>
                            </View>
                        </View>

                    </View>

                    <View style={{flexDirection:‘row‘}}>
                        <View style={{flex:1,borderColor:‘green‘,borderRightWidth:1,flexDirection:‘row‘}}>
                            <View style={{flex:1}}>
                                <Text style={{fontSize:14,color:‘red‘}}>撸串节狂欢</Text>
                                <Text style={{fontSize:12}}>烤串6.6元起</Text>
                            </View>
                            <View style={{flex:1}}>
                                <Image style={styles.hanbaoImage} source={{uri:‘http://ww1.sinaimg.cn/mw690/8d9f2af2gw1f7agt9adphj20ku112x22.jpg‘}}></Image>
                            </View>
                        </View>

                        <View style={{flex:1,flexDirection:‘row‘}}>
                            <View style={{flex:1}}>
                                <Text style={{fontSize:14,color:‘red‘}}>撸串节狂欢</Text>
                                <Text style={{fontSize:12}}>烤串6.6元起</Text>
                            </View>
                            <View style={{flex:1}}>
                                <Image style={styles.hanbaoImage} source={{uri:‘http://ww1.sinaimg.cn/mw690/0068acO1jw1f7ajiogif1j30zk172dnu.jpg‘}}></Image>
                            </View>
                        </View>

                    </View>
                </View>
                <View style={{backgroundColor:‘red‘,height:10}}></View>
      </View>
        </View>
    );
  }
}

const styles = StyleSheet.create({
      view_row:{
         flexDirection:‘row‘,
          paddingTop:20,
      },
       view_column:{
            flexDirection:‘column‘,
            paddingTop:20,
        },
      height_160:{
        height:160,
      },
      marginTextTop_18:{
          marginTop:18,
      },
      marginTextTop_14:{
        marginTop:14,
      },
      partLeft:{
          flex:1,
          borderColor:‘red‘,
          borderWidth:1,
      },
      partRgith:{
          flex:2,
          borderColor:‘red‘,
          borderWidth:1,
      },
      grendTextFontSize:{
          fontSize:14,
          color:‘#55A44B‘,
          textAlign:‘center‘
      },
      red_font:{
          color:‘red‘
      },
        blue_font:{
        color:‘blue‘,
        },
      textfontSize_10:{
          fontSize:10,
      },
      textfontSize_14:{
          fontSize:14,
      },
      yueba_height:{
          height:85,
      },
        hanbaoImage:{
          width:55, height:55,
        },
       hongshaorouImage:{
          width:25, height:25,
       }

});

AppRegistry.registerComponent(‘meituan‘, () => meituan);

  React-Native -课后练习

效果图

仔细不要急 一步一步来

时间: 2024-08-05 00:07:45

React-Native -课后练习的相关文章

后盾 React Native 开发系列视频课程

01 初识react native.mp402 react native优点.mp403 APP开发方式横向对比.mp404 需要的知识储备和学习难点.mp405 ATOM(阿童木)编辑器插件安装.mp406 ATOM插件安装及答疑.mp407 java sdk和NodeJS环境安装.mp408 Android SDK安装.mp409 环境变量的配置方法.mp410 使用npm初始化项目 npm cnpm yarn命令介绍.mp411 使用yarn命令初始化项目.mp412 react nati

谈谈APP架构选型:React Native还是HBuilder

原文链接 导读:最近公司的一款新产品APP要进行研发,老大的意思想用H5来做混合APP以达到高效敏捷开发的目的.我自然就开始进行各种技术选型的调研,这里重点想说的是我最后挑选出的2款hybrid app开发技术方案:RN(react native),HBuilder.React Native是大名鼎鼎的Facebook的开源技术框架,而HBuilder是国内的H5工具开发公 司DCLOUD的产品.我自己先总结下吧:这两个技术框架在开发效率上基本上可以媲美WEB开发的速度,RN强调的是“Learn

react Native如何实现跨平台

react Native是通过虚拟DOM实现跨平台,运行时 将虚拟DOM转换为相应的web编码.android编号.ios编码进行运行的.   代码实现: 01.html: <!DOCTYPE html> <html lang="en"> <head>    <meta charset="UTF-8">    <script src="react.js"></script> 

菜鸟窝React Native 视频系列教程

菜鸟窝React Native 视频系列教程 交流QQ群:576089067 Hi,我是RichardCao,现任新美大酒店旅游事业群的Android Developer.15年加入饿了么即时配送BU,后负责蜂鸟众包Android端,期间引入react-native技术,作为国内react-native 与 Android混合开发的早期商业项目,具有一定经验,同时也是react-native开源项目reading(https://github.com/attentiveness/reading)

菜鸟窝React Native 系列教程-1.移动端开发趋势与未来

菜鸟窝React Native 系列教程-1.移动端开发趋势与未来 课程持续更新中..... 我是RichardCao,现任新美大酒店旅游事业群的Android Developer.如果你也有兴趣录制RN视频,请加入下面QQ群找我. 下载地址:https://pan.baidu.com/s/1c1XmE56 密码:shhw 首发地址:菜鸟窝-ReactNative学习板块 交流QQ群:576089067 课程目录:菜鸟窝React Native 系列教程

【REACT NATIVE 系列教程之五】NAVIGATOR(页面导航)的基本使用与传参

本站文章均为 李华明Himi 原创,转载务必在明显处注明: 转载自[黑米GameDev街区] 原文链接: http://www.himigame.com/react-native/2248.html 今天介绍一种应用开发中常用的负责页面切换及导航功能的组件:Navigator 一:Navigator 对于页面导航其实主要功能就是:每个页面都知道本身应该切换到哪个页面,并且切到的页面会记录从哪里来,如果要返回的话,知道返回到哪个页面.这一切都不需要再用逻辑管理!而且每个页面之间也可以进行参数传递,

React Native Style

React Native不实现CSS而是依赖JavaScript来设置你的应用的样式,这是一个有争议的决定,你可以阅读这些幻灯片了解其背后的基本原理. 申明样式: 1 var styles = StyleSheet.create({ 2 base: { 3 width: 38, 4 height: 38, 5 }, 6 background: { 7 backgroundColor: '#222222', 8 }, 9 active: { 10 borderWidth: 2, 11 border

React Native控件之PullToRefreshViewAndroid下拉刷新组件讲解

转载请标明出处: http://blog.csdn.net/developer_jiangqq/article/details/50664323 本文出自:[江清清的博客] (一)前言 今天我们一起来看一下PullToRefreshViewAndroid下拉刷新组件讲解以及使用实例 刚创建的React Native技术交流群(282693535),欢迎各位大牛,React Native技术爱好者加入交流!同时博客左侧欢迎微信扫描关注订阅号,移动技术干货,精彩文章技术推送! 该PullToRefr

【React Native开发】React Native进行签名打包成Apk

转载请标明出处: http://blog.csdn.net/developer_jiangqq/article/details/50525976 本文出自:[江清清的博客] (一)前言 [好消息]个人网站已经上线运行,后面博客以及技术干货等精彩文章会同步更新,请大家关注收藏:http://www.lcode.org 前几节课程我们对于React Native的一些基础配置,开发工具以及调试,Android项目移植做了相关讲解,今天一起来学习一下另外一个比较重要的知识点,就是React Nativ

React Native ——实现一个简单的抓取github上的项目数据列表

/** * Sample React Native App * https://github.com/facebook/react-native */ 'use strict'; var React = require('react-native'); var { AppRegistry, StyleSheet, Text, Image, View, TextInput, ListView, } = React; var GIT_URL = 'https://api.github.com/sea