Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react native popup backgroud style issue #1234

Closed
darin-lao opened this issue Apr 28, 2017 · 7 comments
Closed

react native popup backgroud style issue #1234

darin-lao opened this issue Apr 28, 2017 · 7 comments

Comments

@darin-lao
Copy link

What problem does this feature solve?

希望背景可以自定义颜色,现在是无法设置透明的,可以嵌套的组件设置透明后,后面有一个白色的背景,是不理rn-topview默认了白色背景

What does the proposed API look like?

可以默认默认背景

@paranoidjk paranoidjk added the RN label Apr 28, 2017
@paranoidjk
Copy link
Contributor

太多错别字,没理解你到底是想设置蒙版的背景还是modal的背景。

最好提供一个截图。

@paranoidjk
Copy link
Contributor

蒙版的背景是灰色,也不是你说的白色。

@darin-lao
Copy link
Author

首先设置了红色的背景,无问题

 Popup.show(<View style={{height:400,backgroundColor:'#ff0000ff'}}>
            <Image onPress={()=>{Popup.hide()}} style={{width:80,height:80,marginLeft:10}} source={BannerImage[1]}/>
            <View style={{backgroundColor:'#ff0000',marginTop:40}}>
                <Text onPress={()=>{Popup.hide()}}>隐藏</Text>
            </View>
        </View>,{animationType: 'slide-up', maskClosable: true})

然后设置背景的透明度

 Popup.show(<View style={{height:400,backgroundColor:'#ff000000'}}>
            <Image onPress={()=>{Popup.hide()}} style={{width:80,height:80,marginLeft:10}} source={BannerImage[1]}/>
            <View style={{backgroundColor:'#ff0000',marginTop:40}}>
                <Text onPress={()=>{Popup.hide()}}>隐藏</Text>
            </View>
        </View>,{animationType: 'slide-up', maskClosable: true})

最后组件面板背景是白色,不是透明

@silentcloud
Copy link
Contributor

@darin-lao rn-topview 没有设置图层,所以不会存在背景色白色的问题

@darin-lao
Copy link
Author

@silentcloud 现在Popup组件会默认给一个白色的背景

@silentcloud
Copy link
Contributor

好 我 check 一下

@silentcloud
Copy link
Contributor

@darin-lao 这里默认了 https://github.com/react-component/dialog/blob/master/src/Modal.tsx#L19 ,应该也是符合预期的,popup 的设计应该是这个样子的。如果你想要自己改变背景色,我可以加一个 style 来覆盖那个 content 样式,然后你自己用 PopupContainer 来实现

lixiaoyang1992 pushed a commit to lixiaoyang1992/ant-design-mobile that referenced this issue Apr 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants