Comments (7)
另,仔细查看代码,发现,此乃神人也。代码逻辑如此严谨,清晰。
from teaset.
1、 设计时所有组件都是可以单独使用的,比如只使用Label:
import Label from 'teaset/components/Label/Label';
不过我没有测试过,你可以试试看,应该是可以的。
2、可以弹出任何内容,具体可参考OverlayExample.js,查看Overlay.js可以看出来Overlay.show的参数没有任何限制,可以是任何View,不过我建议弹出的View继承自Overlay.View并加上自己的逻辑,Overlay.PullView, Overlay.PopView, Overlay.PopoverView就是这么做的;
Overlay.View, Overlay.PullView, Overlay.PopView, Overlay.PopoverView是Overlay的静态变量,意味着你可以替换成你自己的class以改变弹出层的默认样式和行为,例如:
Overlay.View = MyOverlayView;
from teaset.
大神,目前有一个需求,想用你的来实现。就是点击Listview的item某一个控件,然后点击的item的控件旁边展示一个弹出层,弹出层高亮,屏幕其他弹出层遮罩,变灰。想用你这个来实现,不知道如何下手,大神可有思路,求指导。
from teaset.
不知道这是不是你想要的效果:
<ListRow title='测试左边弹出' detail={
<Button title='点我弹出' ref='popoverButton' onPress={() => this.onPopoverButtonPress()} />
} />
onPopoverButtonPress() {
this.refs['popoverButton'].measureInWindow((x, y, width, height) => {
let fromBounds = {x, y, width, height};
let overlayView = (
<Overlay.PopoverView
fromBounds={fromBounds}
direction='left'
align='start'
directionInsets={4}
showArrow={false}
overlayOpacity={0.4}
>
<View style={{height: 60, padding: 10}}>
<Label size='lg' text='这是内容' />
</View>
</Overlay.PopoverView>
);
Overlay.show(overlayView);
});
}
如果是,把
<View style={{height: 60, padding: 10}}>
<Label size='lg' text='这是内容' />
</View>
替换成你要显示的内容就行了
from teaset.
您好,我遇到一些问题:
1-:_renderRow(rowData) {
return (
<GoodInCell
msg='GoodInCell'
rowData={rowData}
onSelected={()=>{
this.onPopoverButtonPress();
}}
onSelectedByType={(type)=>{
this._onSelectedByType(type)
}}
/>
);
}
2-:GoodinCell:
let refMsg=this.props.msg;
<TouchableOpacity
ref={refMsg}
onPress={()=>{
this.onSelected();
}}>
<Image source={require('../../images/icon_time.png')} style={styles.iconBtn} />
2-:点击弹出方式还是按照你给的代码进行了简单修改,
点击时:
undefined is not an object (evaluating 'this.refs['GoodInCell'].measureInWindow')
排查不到问题,大神,有遇到类似的吗?
from teaset.
问题已经解决,谢谢大神,之前提供的方式可行。
from teaset.
很好 如有需要 会选择的
from teaset.
Related Issues (20)
- oncloseRequest 和 modal
- The development server returned response error code: 500 HOT 4
- 麻烦兼容下rn 0.64.0 HOT 12
- react-native 0.64.0 不能正常使用 HOT 14
- import Easing error HOT 1
- _opacityActive 有关问题 HOT 1
- Unable to resolve module react-native/Libraries/Animated/src/Easing from ../node_modules/teaset/components/ListRow/TouchableOpacity.js
- Unable to resolve module react-native/Libraries/Animated/src/Easing from /Users/Edmond/WorkSpace/Global1V1/zeus_android/node_modules/teaset/components/ListRow/TouchableOpacity.js
- PullVIew HOT 2
- input标签禁用
- 这行代码为什么不显示呢 HOT 1
- Error: Unable to resolve module react-native/Libraries/Animated/src/Easing from D:\working_workspace\waterproof_project\6.code\newWaterproofApp\node_modules\teaset\components\ListRow\TouchableOpacity.js: react-native/Libraries/Animated/src/Easing could not be found within the project or in these directories: HOT 4
- Drawer组件非常卡顿,检查后发现放进去的view会被挂载9次!!! HOT 1
- 有人有同样的问题么? 我最近在升级0.66 升级完之后发现 toast menu 都无效了也没有错误 HOT 1
- version diff -- Libraries/Pressability/Pressability.js 0.660. 0.62.0 version API differences, these APIs need to be updated if the latest version is used
- 库组件import目录问题 HOT 1
- 作者不维护了吗 HOT 6
- Wheel 滑动 bug HOT 1
- ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types' HOT 2
- 有没有考虑继续迭代
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from teaset.