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

Button with ImageSource that's too big for button renders incorrectly #15004

Closed
jknaudt21 opened this issue May 9, 2023 · 3 comments
Closed
Labels
area-controls-button Button, ImageButton platform/android 🤖 platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@jknaudt21
Copy link
Contributor

Description

Creating a button that uses an ImageSource but constrained dimensions (i.e the WidthRequest is too small for the image) will render a button that, depending on the platform will display incorrectly. The image will either be improperly aligned or simply display entirely. Windows seems to be working fine, the other platforms seem to be affected.

Sample code:

    <StackLayout>
            <Button Text="Some random text that I've typed to occupy space"
                    BackgroundColor="AliceBlue"
                    ImageSource="dotnet_bot.png"
                    WidthRequest="100"
                    TextColor="Black"
                    />
    </StackLayout>

On iOS and Mac, the button should have text to repro this bug. On Android the button doesn't need text

iOS
image

Mac
image

Android
image

Steps to Reproduce

  1. Build MAUI using the latest in main
  2. On the sandbox project, add this to the main page:
    <StackLayout>
            <Button Text="Some random text that I've typed to occupy space"
                    BackgroundColor="AliceBlue"
                    ImageSource="dotnet_bot.png"
                    WidthRequest="100"
                    TextColor="Black"
                    />
    </StackLayout>
  1. Build and deploy

Link to public reproduction project repository

(see description)

Version with bug

8.0 previews

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android, macOS

Affected platform versions

Mac, Android, iOS

Did you find any workaround?

No response

Relevant log output

No response

@jknaudt21 jknaudt21 added t/bug Something isn't working platform/macOS 🍏 macOS / Mac Catalyst platform/android 🤖 platform/iOS 🍎 area-controls-button Button, ImageButton labels May 9, 2023
@ghost ghost added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 9, 2023
@mattleibow mattleibow added this to the Backlog milestone May 10, 2023
@ghost
Copy link

ghost commented May 10, 2023

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

@XamlTest XamlTest added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Sep 14, 2023
@XamlTest
Copy link
Collaborator

Verified this on Visual Studio Enterprise 17.8.0 Preview 1.0. Repro on Android 13.0-API33 and iOS 16.4(8.0.0-preview.7.8842), not repro on Windows 11 with below Project:
15004.zip

@PureWeen
Copy link
Member

PureWeen commented May 9, 2024

Duplicate of #22306

@PureWeen PureWeen marked this as a duplicate of #22306 May 9, 2024
@PureWeen PureWeen closed this as completed May 9, 2024
@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jun 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-button Button, ImageButton platform/android 🤖 platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants