Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Autosize Label TextCompat pre android 8 doesn't autosize text #241

Open
@AdamDiament

Description

@AdamDiament

Xamarin.Android Version (eg: 6.0):

7 and below have the issue. 8+ works as expected.

Operating System & Version (eg: Mac OSX 10.11):

Windows 10

Support Libraries Version (eg: 23.3.0):

using Android.Support.V4.Widget.TextViewCompat; (nuget package for compat not explicitly installed. I tried installing both v4 and v7 and it made no difference)

Describe your Issue:

TextViewCompat.SetAutoSizeTextTypeUniformWithConfiguration does not work as expected on android pre-8, when used in a custom renderer in a xamarin forms project. According to the docs it should provide backwards compatibility to android 4+. Font size should shrink as to not overflow the text bounds, it doesn't.

Steps to Reproduce (with link to sample solution if possible):

Sample solution zip: (rebuild as bin/obj folders were deleted).
TestAutoSizeTextView.zip

  1. Rebuild the project and start on an Android 8 or higher device. The page loads and you see this screen with the text resizing correctly in the three labels with Aqua backgrounds.

image

  1. Load the same project on an android 7 device. The following behaviour is seen, text doesn't resize as expected.

image

Include any relevant Exception Stack traces, build logs, adb logs:

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions