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

ImageStyleProps borderRadius #3456

Closed
Tatious opened this issue Oct 17, 2019 · 4 comments
Closed

ImageStyleProps borderRadius #3456

Tatious opened this issue Oct 17, 2019 · 4 comments
Assignees

Comments

@Tatious
Copy link

Tatious commented Oct 17, 2019

Environment

react-native-cli: 2.0.1
react-native: 0.60.6
-- (empty) -- react-native-windows@0.60.0-vnext.32
node: v10.16.3
npm: 6.9.0
yarn: 1.17.3

  • SDK Version(s):
    10.0.18362.0

  • Target Device(s):
    Desktop

  • Visual Studio Version:
    Visual Studio 2017

  • Build Configuration:
    Debug

Steps to Reproduce

This is the expected way to create a round image:

return (
    <Image
        source={{ uri: getResizeUrl(url, pixelSize, pixelSize) }}
        style={{ height: size, width: size, borderRadius: size }}
    />
);

However, this does not work and results in no change from a square image, but I found view does apply the borderRadius attribute as follows:

return (
    <View style={{borderRadius: size}}>
        <Image
            source={{ uri: getResizeUrl(url, pixelSize, pixelSize) }}
            style={{ height: size, width: size }}
        />
    </View>
);

Expected Behavior

The image would be rounded

Actual Behavior

There is no effect on the image

Additional context

Adam Gorman(adamgor)
Austin Beaulieu(aubeauli)

@ghost ghost added the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label Oct 17, 2019
@Tatious Tatious changed the title Describe the problem rorderRadius attribute has no effect on images Oct 17, 2019
@Tatious Tatious changed the title rorderRadius attribute has no effect on images borderRadius attribute has no effect on images Oct 17, 2019
@namrog84
Copy link
Contributor

Confirming this is a member on my team and should be flagged as Partner(Xbox)

@chrisglein chrisglein added Area: Borders and Brushes Partner: Xbox (label may be applied by bot based on author) Area: Image labels Oct 28, 2019
@chrisglein
Copy link
Member

CornerRadius (which is how XAML does rounded corners) doesn't have universal support on all elements. In particular... it's not available on Image. It actually had extremely uneven support on various controls although the most recent drop of WinUI has cleaned that up.

I'm fairly certain we'll either need WinUI3 to be available and then add support for this to Image.

@chrisglein chrisglein added the Needs WinUI 3 Indicates that feature can only be done in WinUI 3.0 or beyond. label Oct 28, 2019
@chrisglein chrisglein added this to the vNext Milestone 5 milestone Oct 28, 2019
@marlenecota marlenecota changed the title borderRadius attribute has no effect on images ImageStyleProps borderRadius Oct 31, 2019
@chrisglein chrisglein removed the Needs WinUI 3 Indicates that feature can only be done in WinUI 3.0 or beyond. label Oct 31, 2019
@chrisglein
Copy link
Member

Getting feedback that XAML may actually support this level of masking, but not natively on Image (it'd need to be wrapped).

@Tatious does this work if you wrap it on a View and apply the borderRadius there? That may be a viable workaround. Let us know if that does or does not work.

@ddalp
Copy link
Contributor

ddalp commented Dec 16, 2019

cornerRadius and other border properties are supported now, background on image is still not supported (I will open a new issue to track).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants