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

[Bug] [Android] Rendering issue of a date picker inside a stack layout #14942

Open
rajeshtamda opened this issue Dec 1, 2021 · 0 comments
Open

Comments

@rajeshtamda
Copy link

Description

Create few View Cell's with some random labels and at least one View Cell with a Date Picker whose date is initialized with a day/ month of single digit value. Now when you try to change the value of the date picker after launching the app if you alter that single digit day/month with a double digit value you start to notice that your year value gets truncated by those many number of digits as your additional digits in your new day/month. If you have enough number of cells so that you can scroll this particular cell out of sight and come back, then only you can see the whole value properly.

I can currently able to replicate this issue on any android emulator, Mi A3, Galaxy A51.

This bug only occurs on android.

Steps to Reproduce

  1. Create a TableView with a number of ViewCell's one of which shall contain a date picker
  2. Initialize the DatePicker's date to some date which takes single digit in its day/month field or both (Ex: July 4th 2021 / Oct 3rd 2021)
  3. Once the view is loaded try to change the date to a value which has double digit in its day/month (Ex: Nov 24th 2021 / Oct 13th 2021)

Here is my sample code:

<TableRoot>
    <TableSection TextColor="DimGray" >
        <ViewCell>
            <Label BackgroundColor="Transparent" Text="Learn more at https://aka.ms/xamarin-quickstart" />
        </ViewCell>
        <ViewCell >
            <StackLayout BackgroundColor="White" Orientation="Horizontal" Padding="10, 50">
                <Label  HorizontalOptions="StartAndExpand" BackgroundColor="Transparent" TextColor="Black" Text="Start developing now" FontSize="Title" />
                <DatePicker HorizontalOptions="End" Date="08-07-2021"></DatePicker>
                <TimePicker HorizontalOptions="End"></TimePicker>
            </StackLayout>
        </ViewCell>
        <ViewCell>
            <StackLayout BackgroundColor="White" Orientation="Horizontal" Padding="10, 50">
                <Label  BackgroundColor="Transparent" TextColor="Black" Text="Start developing now" FontSize="Title" />
                <Label  BackgroundColor="Transparent" TextColor="Black" Text="Make changes to your XAML file and save to see your UI update in the running app with XAML Hot Reload. Give it a try!" />
            </StackLayout>
        </ViewCell>
        <ViewCell>
            <StackLayout BackgroundColor="White" Orientation="Horizontal" Padding="10, 50">
                <Label  BackgroundColor="Beige" TextColor="Black" Text="Start developing now" FontSize="Title" />
                <Label  BackgroundColor="Transparent" TextColor="Black" Text="Make changes to your XAML file and save to see your UI update in the running app with XAML Hot Reload. Give it a try! \n Make changes to your XAML file and save to see your UI update in the running app with XAML Hot Reload. Give it a try! \n Make changes to your XAML file and save to see your UI update in the running app with XAML Hot Reload. Give it a try!" />
            </StackLayout>
        </ViewCell>
    </TableSection>
</TableRoot>

Here is the same view but made from a ScrollView and StackLayout combination instead, note that this also displays similar behavior only that even after scrolling up and down, issue never gets resolved in this case:

<StackLayout Orientation="Vertical">
    <Label BackgroundColor="Transparent" Text="Learn more at https://aka.ms/xamarin-quickstart" />
    <StackLayout BackgroundColor="White" Orientation="Horizontal" Padding="10, 50">
        <Label  HorizontalOptions="StartAndExpand" BackgroundColor="Transparent" TextColor="Black" Text="Start developing now" FontSize="Title" />
        <DatePicker HorizontalOptions="End" Date="08-07-2021"></DatePicker>
        <TimePicker HorizontalOptions="End"></TimePicker>
    </StackLayout>
    <StackLayout BackgroundColor="White" Orientation="Horizontal" Padding="10, 50">
        <Label  BackgroundColor="Transparent" TextColor="Black" Text="Start developing now" FontSize="Title" />
        <Label  BackgroundColor="Transparent" TextColor="Black" Text="Make changes to your XAML file and save to see your UI update in the running app with XAML Hot Reload. Give it a try!" />
    </StackLayout>
    <StackLayout BackgroundColor="White" Orientation="Horizontal" Padding="10, 50">
        <Label  BackgroundColor="Beige" TextColor="Black" Text="Start developing now" FontSize="Title" />
        <Label  BackgroundColor="Transparent" TextColor="Black" Text="Make changes to your XAML file and save to see your UI update in the running app with XAML Hot Reload. Give it a try! \n Make changes to your XAML file and save to see your UI update in the running app with XAML Hot Reload. Give it a try! \n Make changes to your XAML file and save to see your UI update in the running app with XAML Hot Reload. Give it a try!" />
    </StackLayout>
</StackLayout>

Expected Behavior

Screenshot_1638369508

Actual Behavior

Screenshot_1638369489

Basic Information

  • Version with issue: 5.0.0.2244
  • Last known good version: ?
  • Platform Target Frameworks:
    • iOS:
    • Android: 10
    • UWP:
  • Android Support Library / AndroidX Version:
  • NuGet Packages:
    • Xamarin Forms 5.0.0.2244
    • Xamarin Essentials 1.7.0
    • NetStandard.Library 2.0.3
  • Affected Devices: Mi A3, Galaxy A51 and few other devices, Any Android Emulator running Android 10 / 11

Environment

Show/Hide Visual Studio info
Microsoft Visual Studio Professional 2019
Version 16.11.6
VisualStudio.16.Release/16.11.6+31829.152
Microsoft .NET Framework
Version 4.8.04084

Installed Version: Professional

Visual C++ 2019   00435-60000-00000-AA373
Microsoft Visual C++ 2019

Azure App Service Tools v3.0.0   16.11.94.52318
Azure App Service Tools v3.0.0

C# Tools   3.11.0-4.21403.6+ae1fff344d46976624e68ae17164e0607ab68b10
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Dotfuscator Community Edition   6.3.0+8b29d6f4a2
PreEmptive Protection - Dotfuscator CE

Extensibility Message Bus   1.2.6 (master@34d6af2)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

GitHub.VisualStudio   2.11.102.28613
A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

IncrediBuild Build Acceleration   1.5.0.13
IncrediBuild effectively reduces compilation and development times by up to 90%.

IntelliCode Extension   1.0
IntelliCode Visual Studio Extension Detailed Info

JetBrains ReSharper 2021.2.2   Build 212.0.20211006.155518
JetBrains ReSharper package for Microsoft Visual Studio. For more information about ReSharper, visit http://www.jetbrains.com/resharper. Copyright © 2021 JetBrains, Inc.

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards   1.0
Microsoft Visual C++ Wizards

Microsoft Visual Studio VC Package   1.0
Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio   16.10.15 (552afdf)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager   5.11.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension   1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

SQL Server Data Tools   16.0.62110.27130
Microsoft SQL Server Data Tools

Visual Basic Tools   3.11.0-4.21403.6+ae1fff344d46976624e68ae17164e0607ab68b10
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools   16.11.0-beta.21514.6+b6c2c4f53ea3a08fa603ea93d6d2f808a62a21d1
Microsoft Visual F# Tools

Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

VisualStudio.DeviceLog   1.0
Information about my package

VisualStudio.Foo   1.0
Information about my package

VisualStudio.Mac   1.0
Mac Extension for Visual Studio

Xamarin   16.11.000.190 (d16-11@2391ed9)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer   16.11.0.47 (remotes/origin/d16-11@e0d612363)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates   16.10.5 (355b57a)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK   12.0.0.3 (d16-11/f0e3c2d)
Xamarin.Android Reference Assemblies and MSBuild support.
    Mono: c633fe9
    Java.Interop: xamarin/java.interop/d16-11@476bb5b
    ProGuard: Guardsquare/proguard/v7.0.1@912d149
    SQLite: xamarin/sqlite/3.35.4@85460d3
    Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-11@87af37b


Xamarin.iOS and Xamarin.Mac SDK   15.0.0.8 (0796d78dc)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

Reproduction Link

TableViewIssuesDemo.ZIP

@rajeshtamda rajeshtamda added s/unverified New report that has yet to be verified t/bug 🐛 labels Dec 1, 2021
@jsuarezruiz jsuarezruiz added a/layout and removed s/unverified New report that has yet to be verified labels Dec 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants