Xamarin.forms: Visual="Material" making the iOS Button Text to Upper Case

Created on 12 Mar 2019  Â·  6Comments  Â·  Source: xamarin/Xamarin.Forms

Description

<Button Text="Material Button" Visual="Material"/>

is changing the iOS button text also to upper. Is there any property present to make the button text smaller / configurable?

Steps to Reproduce

create button with material option
<Button Text="Material Button" Visual="Material"/>

Expected Behavior

Is should display the same text i have given "Material Button"

Actual Behavior

It is displaying ""MATERIAL BUTTON"

Basic Information

  • Version with issue: 3.6.x
visual proposal-open enhancement âž•

Most helpful comment

This issue doesn't apply only to the Material Design renderers for Visual. Basic Android Material will do this also.

How about we default to Material but allow the developer to express specific expectations in a style?

I don't think this should be the material attached properties alone.

Looking at UWP It appears you would use a text converter to drive this behavior. In web/css you use text-transform. I think the latter covers all the bases. The former alone would require implicitly overriding what the renderer default was, in this case all uppercase.

<Button Text="Button" TextTransform="Lowercase"/>

Other values:

  • none (default)
  • capitalize - first of each word is uppercase
  • uppercase (material defaul)
  • lowercase

@PureWeen @samhouts

All 6 comments

This behavior is according to the spec material design.

By default Material uses capitalized button text labels

But most likely a setting will be added to disable uppercaseTitle

@paymicro I agree!!!! But if we can expose a property for this feature. It will be an add on advantage. Since control with All CAP doesn't look that great in iOS. :)

A setting to diable UPPERCASE would be helpfull! For Android it works also if setting the Android styles.xml to false but in iOS, UWP, WPF it has no effect. Please improve this.

I used CustomRenderer to to resolve this issue, you can inherit MaterialButtonRenderer and set Control.UppercaseTitle = false

This issue doesn't apply only to the Material Design renderers for Visual. Basic Android Material will do this also.

How about we default to Material but allow the developer to express specific expectations in a style?

I don't think this should be the material attached properties alone.

Looking at UWP It appears you would use a text converter to drive this behavior. In web/css you use text-transform. I think the latter covers all the bases. The former alone would require implicitly overriding what the renderer default was, in this case all uppercase.

<Button Text="Button" TextTransform="Lowercase"/>

Other values:

  • none (default)
  • capitalize - first of each word is uppercase
  • uppercase (material defaul)
  • lowercase

@PureWeen @samhouts

Was this page helpful?
0 / 5 - 0 ratings