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

[Bug] Button CornerRadius not working #2494

Closed
juansturla opened this issue Sep 15, 2021 · 4 comments
Closed

[Bug] Button CornerRadius not working #2494

juansturla opened this issue Sep 15, 2021 · 4 comments
Labels
legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor

Comments

@juansturla
Copy link

juansturla commented Sep 15, 2021

Description

The view Button has the property "CornerRadius" but it's not working (at least on Android)

Extra info

  • The IButton does not include CornerRadius property

Steps to Reproduce

  1. Create a new Maui project
  2. Add a button
  3. Add CornerRadius property

Expected Behavior

The button becomes rounded

Actual Behavior

The button remains without corner radius

Basic Information

  • Version with issue: Maui-preview8
  • Last known good version: -
  • IDE: VS 2022 preview4
  • Platform Target Frameworks:
    • Android: API31

Screenshots

The first button increase the counter, and it changes second button cornerRadius (code-behind)
The third button (rounded) was achieved using handlers
The fourth button has the CornerRadius binded to the slider's value (from 0 to 100)

image

Workaround

It can be achieved using a handler

 Microsoft.Maui.Handlers.ButtonHandler.ButtonMapper.Add(nameof(IButton.Background), (h, v) => {
#if __ANDROID__
                if(v is CustomButton)
                {

                h.NativeView.CornerRadius = 25;
                }
#endif
            });
@juansturla
Copy link
Author

Related to #650

@Eilon Eilon added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Oct 5, 2021
@bricefriha
Copy link

Now that issue #2844 is solved does it means that this one is solved too, or are they two unrelated issues? 🙂

@juansturla
Copy link
Author

I don't know, I will have to check it again with the latest preview

@juansturla
Copy link
Author

Yes, the XAML corner radius now it's working on Button on Preview 9

@ghost ghost locked as resolved and limited conversation to collaborators Feb 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor
Projects
None yet
Development

No branches or pull requests

3 participants