Skip to content

Instantly share code, notes, and snippets.

@zi6xuan
Created September 21, 2018 06:42
Show Gist options
  • Save zi6xuan/e7eb275ff88934b882376ecaa982972f to your computer and use it in GitHub Desktop.
Save zi6xuan/e7eb275ff88934b882376ecaa982972f to your computer and use it in GitHub Desktop.
一个悬浮在手机顶端的信息提示框
import { Theme, Overlay } from 'teaset';
export function BBox(msg: strings) {
let overlayView = (
<Overlay.PullView
containerStyle={{ alignItems: 'stretch', justifyContent: 'flex-start', backgroundColor: '#00000000', }}
side='top'
overlayOpacity={0}>
<View style={{ justifyContent: 'center', backgroundColor: '#000000D1', height: 120, paddingTop: Theme.statusBarHeight }}>
<Text style={{ fontSize: 15, margin: 5, color: 'white' }}>{msg}</Text>
</View>
</Overlay.PullView>
);
let bbox = Overlay.show(overlayView);
setTimeout(() => {
Overlay.hide(bbox);
}, 5000);
return bbox;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment