1.代码

/**
* 购物车
*/
import React, {Component} from 'react';
import {
View,
Image,
} from 'react-native';
import { BaseContainer } from '../../../components';
import Icon from 'react-native-vector-icons/Ionicons'; //引入图标
import { Theme, Drawer, ListRow, Button } from 'teaset';
import { images } from '../../../res'; export default class ShopCarPage extends Component {
constructor(props) {
super(props); this.state = {
rootTransform: 'none'
};
} // 显示或隐藏侧边菜单(抽屉)
toggleMenu(side){
let { rootTransform } = this.state;
this.drawer = Drawer.open(this.renderDrawerMenu(), side, rootTransform);
} // 侧边菜单(抽屉)
renderDrawerMenu(){
return (
<View style={{backgroundColor: Theme.defaultColor, width: 260, flex: 1}}>
<View style={{height: 60}} />
<ListRow
icon={
<View style={{paddingRight: 12}}>
<Image style={{width: 30, height: 30, tintColor: Theme.primaryColor}} source={images.error} />
</View>
}
title='User name'
/>
<ListRow
icon={images.error}
title='Home'
/>
<ListRow
icon={images.error}
title='Store'
bottomSeparator='none'
/>
<View style={{flex: 1}} />
<Button type='link' size='sm' title='Hide' onPress={() => this.drawer && this.drawer.close()} />
</View>
);
} render() {
return (
<BaseContainer
hideLeft
title={'购物车'}
rightView={<Icon name='md-home' size={30} onPress={() => this.toggleMenu('left')} />}
>
</BaseContainer>
)
}
}

2.效果图

最新文章

  1. ios 使用block中使用self可能产生的循环引用
  2. Requests库上传文件时UnicodeDecodeError: &#39;ascii&#39; codec can&#39;t decode byte错误解析
  3. Swift 实现下拉刷新 JxbRefresh
  4. [转]谈谈select, iocp, epoll,kqueue及各种网络I/O复用机制
  5. SetTimer函数的用法
  6. ios(苹果公司的移动操作系统)
  7. sqlplus部署
  8. uitableview 关于键盘挡住输入框解决方法
  9. 云栖大会day2总结 上午
  10. scrapy框架爬取妹子图片
  11. spring05-Spring事务管理
  12. Winform 基础一 panel
  13. springSecurity初步认识和执行流程
  14. jenkin 不必要的Execute shell执行失败,导致jenkins都失败的解决
  15. [hihoCoder] 第五十二周: 连通性&#183;一
  16. Codeforces Round #279 (Div. 2) B - Queue 水题
  17. 制作一个控制台小程序,要求:用户可以在控制到录入学生的姓名,当用户输入quit(不区分大小写)时,程序停止接收用户输入,并且显示出学生个数及姓名
  18. java 抽象类&amp;接口
  19. [转载]FFmpeg完美入门[4] - FFmpeg应用实例
  20. ActionContextCleanUp

热门文章

  1. c#读取LOG文件并解决读取提示被其他进程占用问题
  2. .NET Core Runtime ARM32 builds now available
  3. Request 部分功能
  4. python——入门系列(一)索引与切片
  5. win7 office2016 激活(2018.6.17测试可用)
  6. Python3 数字
  7. The 15th Zhejiang Provincial Collegiate Programming Contest Sponsored by TuSimple -A Peak
  8. 洛谷——P1102 A-B数对
  9. oracle to_char FM099999
  10. C#外围工具资源