Skip to content

Commit 052ad86

Browse files
Amber-Nan杨楠
andauthored
fix(DragDrawer):修复内容无 法滚动问题及文档更新 (#364)
* fix(Divider):优化 gutter属性不生效问题 * feat(Divider): 增加分割线标题的位置调整功能 & 更新文档 * feat(Rating):增加自定义每项的提示信息 & 更新文档 * feat(Rating):增加只读功能 & 文档更新 * feat(Timeline): 增加改变时间轴内容相对位置功能 & 文档更新 * style(Timeline):Update Readme.md img * feat(Timeline):增加自定义图标 & 文档更新 * feat(Timeline):优化自定义图标 & 文档更新 * feat:新增Calendar 日历组件 * doc(website): Update Calendar Readme.md * feat(Calendar):增加农历及假期展示 && 文档更新 * feat(Calendar):增加假日文字颜色 * feat(Calendar):左上角按钮增加自定义跳转功能&文档更新 * feat(Calendar):优化农历假日及文字排版 * feat(Calendar):处理文字长度 * fix(Calendar):优化安卓文字排版 * feat(Calendar):增加农历详情展示 & 文档更新 * feat(DragDrawer):新增DragDrawer 拖曳抽屉 & 文档更新 * doc(website): 增加DragDrawer目录 * feat(DragDrawer):增加自定义图标 & 文档更新 * feat(DragDrawer): 增加抽屉自定义样式 & 文档更新 * feat(DragDrawer): 增加抽屉自定义样式 & 文档更新 * feat(DragDrawer):自定义抽屉样式 * doc(website): Update ios打包Readme.md * doc(website): Update TreeSelect Readme.md * doc(website): Update Readme.md * style(website): Update Readme.md * feat(TextArea):增加多行输入框 & 文档更新 * fix(DragDrawer):修改组件展示示例 * feat(TextArea):增加字数展示 && 文档更新 * doc(website): Update Android(Mac) 打包 Readme.md * fix(DragDrawer):修复内容无法滚动问题及文档更新 Co-authored-by: 杨楠 <yangnan@nihaosi.com>
1 parent b70a204 commit 052ad86

File tree

3 files changed

+35
-27
lines changed

3 files changed

+35
-27
lines changed

example/examples/src/routes/DragDrawer/index.tsx

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,39 @@
11
import React, {useState, Fragment} from 'react';
2-
import {View, Text} from 'react-native';
3-
import {DragDrawer, Card, Icon} from '@uiw/react-native';
2+
import {View, Text, FlatList} from 'react-native';
3+
import {DragDrawer, Card, Icon, List} from '@uiw/react-native';
44
import Layout, {Container} from '../../Layout';
55
import {ComProps} from '../../routes';
66
const {Header, Body, Footer} = Layout;
7-
7+
const data = [];
8+
for (let i = 1; i < 21; i++) {
9+
data.push(i);
10+
}
811
export interface DragDrawerViewProps extends ComProps {}
912
export default function DragDrawerView({route}: DragDrawerViewProps) {
1013
const description = route.params.description;
1114
const title = route.params.title;
15+
16+
const renderItem = ({item}) => (
17+
<View style={{borderWidth: 0.5, padding: 10, borderColor: '#D9D9D9'}}>
18+
<Text style={{fontSize: 20, textAlign: 'center'}}>{item}</Text>
19+
</View>
20+
);
1221
return (
1322
<Fragment>
1423
<DragDrawer
1524
drawerHeight={350}
1625
// drawerBackgroundColor='lightblue' //抽屉背景
1726
// icon={<Icon name="smile" fill="red" size={30} />} //自定义拖曳图标
1827
>
19-
<View>
20-
<Text>按住图标可上下拖曳抽屉</Text>
21-
</View>
28+
<FlatList
29+
data={data}
30+
renderItem={renderItem}
31+
keyExtractor={item => item.id}
32+
/>
2233
</DragDrawer>
2334
<Container>
2435
<Layout>
2536
<Header title={title} description={description} />
26-
<Body>
27-
<Card title="下边抽屉可上下拖曳">
28-
<Text>下边抽屉可上下拖曳</Text>
29-
</Card>
30-
</Body>
31-
<Footer />
3237
</Layout>
3338
</Container>
3439
</Fragment>

packages/core/src/DragDrawer/README.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,42 +9,46 @@ DragDrawer 拖曳抽屉
99

1010
```jsx
1111
import React, { useState, Fragment } from 'react';
12-
import { View, Text } from 'react-native';
13-
import { DragDrawer, Card, Icon } from '@uiw/react-native';
12+
import { View, Text, FlatList } from 'react-native';
13+
import { DragDrawer, Card, Icon, List } from '@uiw/react-native';
1414
import Layout, { Container } from '../../Layout';
1515
import { ComProps } from '../../routes';
1616
const { Header, Body, Footer } = Layout;
17-
17+
const data = [];
18+
for (let i = 1; i < 21; i++) {
19+
data.push(i);
20+
}
1821
export interface DragDrawerViewProps extends ComProps { }
1922
export default function DragDrawerView({ route }: DragDrawerViewProps) {
2023
const description = route.params.description;
2124
const title = route.params.title;
25+
26+
const renderItem = ({ item }) => (
27+
<View style={{ borderWidth: 0.5, padding: 10, borderColor: '#D9D9D9' }}>
28+
<Text style={{ fontSize: 20, textAlign: 'center' }}>{item}</Text>
29+
</View>
30+
)
2231
return (
2332
<Fragment>
2433
<DragDrawer
2534
drawerHeight={350}
2635
// drawerBackgroundColor='lightblue' //抽屉背景
2736
// icon={<Icon name="smile" fill="red" size={30} />} //自定义拖曳图标
2837
>
29-
<View>
30-
<Text>按住图标可上下拖曳抽屉</Text>
31-
</View>
38+
<FlatList
39+
data={data}
40+
renderItem={renderItem}
41+
keyExtractor={item => item.id}
42+
/>
3243
</DragDrawer>
3344
<Container>
3445
<Layout>
3546
<Header title={title} description={description} />
36-
<Body>
37-
<Card title="下边抽屉可上下拖曳">
38-
<Text>下边抽屉可上下拖曳</Text>
39-
</Card>
40-
</Body>
41-
<Footer />
4247
</Layout>
4348
</Container>
4449
</Fragment>
4550
);
4651
}
47-
4852
```
4953

5054
### props

packages/core/src/DragDrawer/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,8 @@ function DragDrawer(props: DragDrawerProps) {
118118
return (
119119
<Animated.View
120120
style={StyleSheet.flatten([styles.drawer, dynamicDrawerStyles, style, { height: animatedViewHeight }])}
121-
{...panResponder.panHandlers}
122121
>
123-
<Animated.View style={[styles.viewPosition]}>
122+
<Animated.View style={[styles.viewPosition]} {...panResponder.panHandlers}>
124123
<TouchableOpacity activeOpacity={1}>
125124
<View style={[styles.homeContainer]}>{IconCustom(icon)}</View>
126125
</TouchableOpacity>

0 commit comments

Comments
 (0)