Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Enhancement] Allow to override _minimumButtonHeight in ButtonRenderer #12719

Open
softlion opened this issue Nov 3, 2020 · 3 comments
Open

Comments

@softlion
Copy link
Contributor

softlion commented Nov 3, 2020

Description

A Button on iOS seems to ignore vertical padding set to 0.

Steps to Reproduce

  1. Create a Button, set a 0 vertical padding

Expected Behavior

0 vertical padding

Actual Behavior

The button height is 44 points.

Because the ButtonRenderer sets a minimumHeight to 44f.
From Xamarin.Forms.Platform.iOS.ButtonRenderer:

		// This looks like it should be a const under iOS Classic,
		// but that doesn't work under iOS 
		// ReSharper disable once BuiltInTypeReferenceStyle
		// Under iOS Classic Resharper wants to suggest this use the built-in type ref
		// but under iOS that suggestion won't work
		readonly nfloat _minimumButtonHeight = 44; // Apple docs 

                nfloat IButtonLayoutRenderer.MinimumHeight => _minimumButtonHeight;

Basic Information

  • Version with issue: 4.8.0.1560
  • Last known good version: none
  • IDE: Rider
  • Platform Target Frameworks:
    • iOS 13:
  • Nuget Packages: Xamarin.Forms
  • Affected Devices: all

Workaround

None, as methods that could be overriden are all internals.

@softlion softlion added s/unverified New report that has yet to be verified t/bug 🐛 labels Nov 3, 2020
@samhouts samhouts added this to New in Triage Nov 3, 2020
@rmarinho
Copy link
Member

rmarinho commented Nov 3, 2020

I think this is related with the design guidelines for iOS , we can't remove that as it would be a breaking change for everyone.

@rmarinho rmarinho closed this as completed Nov 3, 2020
Triage automation moved this from New to Closed Nov 3, 2020
@softlion
Copy link
Contributor Author

softlion commented Nov 3, 2020

@rmarinho I don't ask you to remove that. I'm asking you to make that customizable :)

@rmarinho rmarinho changed the title [Bug] Remove _minimumButtonHeight in ButtonRenderer [Enhancement] Allow to override _minimumButtonHeight in ButtonRenderer Nov 3, 2020
@rmarinho rmarinho reopened this Nov 3, 2020
Triage automation moved this from Closed to New Nov 3, 2020
@rmarinho rmarinho added this to Under consideration in Enhancements via automation Nov 3, 2020
@rmarinho rmarinho added p/iOS 🍎 a/button and removed s/unverified New report that has yet to be verified t/bug 🐛 labels Nov 3, 2020
@rmarinho
Copy link
Member

rmarinho commented Nov 3, 2020

Ok, i updated the description

@rmarinho rmarinho removed this from New in Triage Nov 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Enhancements
  
Under consideration
Development

No branches or pull requests

2 participants