xamarin/Xamarin.Forms

[iOS] IsEnabled=false is indiscernible from IsEnabled=true on DatePicker and TimePicker

Aperta

#5454 aperta il 5 mar 2019

 (2 commenti) (1 reazione) (0 assegnatari)C# (1926 fork)batch import
e/5 :clock5:help wantedinactivep/iOS 🍎t/bug :bug:up-for-grabs

Metriche repository

Star
 (5644 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Description

Setting IsEnabled=false of an unmodified DatePicker or TimePicker does result in no visual change. Only on a white Page it is possible to see a difference in the BackgroundColor of those Pickers. On Pages with other BackgroundColors this change is indiscernible.

Steps to Reproduce

  1. Download attached Project
  2. Rebuild Solution
  3. Run iOS App
  4. Click on "Toggle IsEnabled" to see that almost nothing happens.
  5. Run Android or UWP App
  6. Click on "Toggle IsEnabled" to see that the Controls get "grayed out"

Alternative:

  1. Create new Solution
  2. Place DatePicker and TimePicker and a Button on the MainView
  3. Wire them up any way you want so that IsEnabled on the Pickers gets set to false or true when clicking the button
  4. Run iOS App
  5. Click the Button to see absolutely nothing happening.
  6. Run Android or UWP App
  7. Click the Button to seethat the Controls get "grayed out"

Expected Behavior

Setting IsEnabled=false "grays out" the Picker so that the user is able to see that the control is disabled

Actual Behavior

Setting IsEnabled=false sets TextColor to Black and sets the BackgroundColor of the control to sligthly less white which is almost indiscernible from IsEnabled=true. If neither TextColor nor BackgroundColor of those Pickers were changed from default, setting IsEnabled=false will not be noticable by users and create confusion over why the control sometimes works, and sometimes not.

Basic Information

  • Version with issue:
  • IDE: Visual Studio Enterprise 2017 15.9.7
  • Platform Target Frameworks:
    • iOS: 10.0
  • Affected Devices:
    • iPhone 6

Reproduction Link

DateTimePickerTest.zip

Additional Information

The way the button is wired up in this test project is only to quickly showcase the problem. Using a ViewModel with bindings for this will result in the very same problem, as the app that I'm currently working on does follow the MVVM and IoC principles.

Guida contributor