dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.14k stars 1.74k forks source link

ViewCell Disappears when unfocused #5292

Closed BinaryAssault closed 7 months ago

BinaryAssault commented 2 years ago

Description

It seems that when you use a ViewCell in any TableView, it will disappear. The disappear seems to occur when something new focuses.

A few examples:

BrokenViewCells-EntryCellFocusBrokenViewCells-PickerNoStackLayout BrokenViewCells-PickerInStackLayoutBrokenViewCells-RadioButtons

Steps to Reproduce

  1. Create a new MAUI .NET App
  2. Add the following to the MainPAge XAML
<Grid>
    <TableView>
        <TableRoot>
            <TableSection Title="Broken ViewCells Section">

                <EntryCell Text="Click me to break a ViewCell!" />

                <ViewCell>
                    <StackLayout BackgroundColor="PaleGreen">

                        <Label Text="Select something" />

                        <Picker>
                            <Picker.Items>
                                <x:String>Item1</x:String>
                                <x:String>Item2</x:String>
                                <x:String>Item3</x:String>
                                <x:String>Item4</x:String>
                            </Picker.Items>
                        </Picker>

                    </StackLayout>
                </ViewCell>

                <ViewCell>
                    <Picker BackgroundColor="PaleVioletRed">
                        <Picker.Items>
                            <x:String>ItemA</x:String>
                            <x:String>ItemB</x:String>
                            <x:String>ItemC</x:String>
                            <x:String>ItemD</x:String>
                        </Picker.Items>
                    </Picker>
                </ViewCell>

                <ViewCell>

                    <StackLayout BackgroundColor="PaleTurquoise" Orientation="Horizontal">

                        <RadioButton Content="Option 1" />
                        <RadioButton Content="Option 2" />
                        <RadioButton Content="Option 3" />

                    </StackLayout>
                </ViewCell>

                <SwitchCell Text="I can also break a ViewCell!" />

            </TableSection>
        </TableRoot>
    </TableView>
</Grid>
  1. Run the app
  2. Click either a Picker or a radio button
  3. Click into a entry or select a switch
  4. Notice the issue

Version with bug

Preview 13 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android, I was not able test on other platforms

Affected platform versions

Android 10

Did you find any workaround?

No

Relevant log output

> am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.companyname.mauiapp_bugs/crc64b666f3464586d4c2.MainActivity"
> Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.companyname.mauiapp_bugs/crc64b666f3464586d4c2.MainActivity }
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/MauiApp_Bugs.dll
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Mono.Android.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.Runtime.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Java.Interop.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.Collections.dll [External]
Resolved pending breakpoint for 'Android.Runtime.JNIEnv.RegisterJniNatives(System.IntPtr, System.Int32, System.IntPtr, System.IntPtr, System.Int32)' to /Users/builder/azdo/_work/2/s/xamarin-android/src/Mono.Android/Android.Runtime/JNIEnv.cs:124 [0x00000].
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.Threading.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.Runtime.InteropServices.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.Threading.Thread.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.Diagnostics.StackTrace.dll [External]
Loaded assembly: data-0xc6297600 [External]
Loaded assembly: data-0xc5e72b00 [External]
Loaded assembly: data-0xc5e7db80 [External]
Loaded assembly: data-0xc5edfe40 [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/netstandard.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.Linq.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.Collections.Concurrent.dll [External]
Resolved pending breakpoint for 'Xamarin.HotReload.HotReloadAgent.BreakpointSendToIde(System.String)' to D:\a\_work\1\s\HotReload\Source\Xamarin.HotReload.Agent\HotReloadAgent.cs:415 [0x00000].
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.Text.Json.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.Text.Encodings.Web.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.ComponentModel.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Microsoft.Maui.Controls.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.ObjectModel.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Microsoft.Maui.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Microsoft.Maui.Graphics.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Microsoft.Extensions.Logging.Abstractions.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.Runtime.Loader.dll [External]
Resolved pending breakpoint for 'Xamarin.HotReload.HotReloadAgent.BreakpointCheckpoint()' to D:\a\_work\1\s\HotReload\Source\Xamarin.HotReload.Agent\HotReloadAgent.cs:410 [0x00000].
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.Reflection.Emit.Lightweight.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.Reflection.Emit.ILGeneration.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.Reflection.Primitives.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Microsoft.Maui.Essentials.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Xamarin.AndroidX.Core.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Microsoft.Extensions.DependencyInjection.Abstractions.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Microsoft.Maui.Controls.Compatibility.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Microsoft.Extensions.Configuration.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Microsoft.Extensions.Configuration.Abstractions.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Microsoft.Extensions.Logging.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Microsoft.Extensions.Primitives.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Microsoft.Maui.Controls.Xaml.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Xamarin.AndroidX.AppCompat.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Xamarin.Google.Android.Material.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.ComponentModel.TypeConverter.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.Private.Uri.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Xamarin.AndroidX.DrawerLayout.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Xamarin.AndroidX.CustomView.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Xamarin.AndroidX.Navigation.Runtime.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Microsoft.Extensions.DependencyInjection.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.Diagnostics.Tracing.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Microsoft.Extensions.Options.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.Linq.Expressions.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.Xml.ReaderWriter.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.Private.Xml.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.Text.Encoding.Extensions.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.Memory.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.Text.RegularExpressions.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.Runtime.CompilerServices.Unsafe.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.Numerics.Vectors.dll [External]
Thread started:  #2
Thread started:  #3
Thread started:  #4
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.Runtime.Serialization.Json.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.Private.DataContractSerialization.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.Runtime.Serialization.Xml.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.Runtime.Serialization.Primitives.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/mscorlib.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Xamarin.AndroidX.SwipeRefreshLayout.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Xamarin.AndroidX.CardView.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Microsoft.Maui.Controls.Compatibility.Android.FormsViewGroup.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Xamarin.AndroidX.RecyclerView.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Xamarin.AndroidX.ViewPager.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Xamarin.AndroidX.Fragment.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Xamarin.AndroidX.Activity.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Xamarin.AndroidX.Lifecycle.ViewModel.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Xamarin.AndroidX.Lifecycle.Common.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Xamarin.AndroidX.SavedState.dll [External]
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Xamarin.AndroidX.ViewPager2.dll [External]
[me.mauiapp_bug] Late-enabling -Xcheck:jni
[me.mauiapp_bug] Unknown bits set in runtime_flags: 0x8000
[me.mauiapp_bug] Unexpected CPU variant for X86 using defaults: x86
[debug-app-helper] Checking if libmonodroid was unpacked to /data/app/com.companyname.mauiapp_bugs-Ld8wpcdx32W3HhxCAZvJfg==/lib/x86/libmonodroid.so
[debug-app-helper] Native libs extracted to /data/app/com.companyname.mauiapp_bugs-Ld8wpcdx32W3HhxCAZvJfg==/lib/x86, assuming application/android:extractNativeLibs == true
[debug-app-helper] Setting up for DSO lookup in app data directories
[debug-app-helper] Added filesystem DSO lookup location: /data/app/com.companyname.mauiapp_bugs-Ld8wpcdx32W3HhxCAZvJfg==/lib/x86
[debug-app-helper] Using runtime path: /data/app/com.companyname.mauiapp_bugs-Ld8wpcdx32W3HhxCAZvJfg==/lib/x86
[debug-app-helper] checking directory: `/data/user/0/com.companyname.mauiapp_bugs/files/.__override__/lib`
[debug-app-helper] directory does not exist: `/data/user/0/com.companyname.mauiapp_bugs/files/.__override__/lib`
[debug-app-helper] Checking whether Mono runtime exists at: /data/user/0/com.companyname.mauiapp_bugs/files/.__override__/libmonosgen-2.0.so
[debug-app-helper] Checking whether Mono runtime exists at: /data/app/com.companyname.mauiapp_bugs-Ld8wpcdx32W3HhxCAZvJfg==/lib/x86/libmonosgen-2.0.so
[debug-app-helper] Mono runtime found at: /data/app/com.companyname.mauiapp_bugs-Ld8wpcdx32W3HhxCAZvJfg==/lib/x86/libmonosgen-2.0.so
[me.mauiapp_bug] Attempt to remove non-JNI local reference, dumping thread
[DOTNET] JNI_OnLoad: JNI_OnLoad in pal_jni.c
[monodroid] Creating public update directory: `/data/user/0/com.companyname.mauiapp_bugs/files/.__override__`
[me.mauiapp_bug] Attempt to remove non-JNI local reference, dumping thread
[monodroid-debug] Trying to initialize the debugger with options: --debugger-agent=transport=dt_socket,loglevel=0,address=10.0.2.2:56870,embedding=1
[monodroid-assembly] open_from_bundles: failed to load assembly MauiApp_Bugs.dll
[monodroid-gc] GREF GC Threshold: 46080
[monodroid-assembly] open_from_bundles: failed to load assembly Mono.Android.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Java.Interop.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Collections.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Threading.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.InteropServices.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Threading.Thread.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Diagnostics.StackTrace.dll
[me.mauiapp_bug] Attempt to remove non-JNI local reference, dumping thread
[monodroid-assembly] open_from_bundles: failed to load assembly netstandard.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Linq.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.VisualStudio.DesignTools.TapContract.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.VisualStudio.DesignTools.TapContract.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.HotReload.Contracts.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.HotReload.Contracts.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Collections.Concurrent.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Text.Json.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Text.Encodings.Web.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.ComponentModel.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Maui.Controls.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.HotReload.Contracts.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.HotReload.Contracts.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.VisualStudio.DesignTools.TapContract.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.VisualStudio.DesignTools.TapContract.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.ObjectModel.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Maui.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Maui.Graphics.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.Logging.Abstractions.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.Loader.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Reflection.Emit.Lightweight.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Reflection.Emit.ILGeneration.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Reflection.Primitives.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Maui.Essentials.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Core.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.DependencyInjection.Abstractions.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Maui.Controls.Compatibility.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.Configuration.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.Configuration.Abstractions.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.Logging.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.Primitives.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Maui.Controls.Xaml.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.AppCompat.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.Google.Android.Material.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.ComponentModel.TypeConverter.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Private.Uri.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.DrawerLayout.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.CustomView.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Navigation.Runtime.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.DependencyInjection.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Diagnostics.Tracing.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.Options.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Linq.Expressions.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Xml.ReaderWriter.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Private.Xml.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Text.Encoding.Extensions.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Memory.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Text.RegularExpressions.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.CompilerServices.Unsafe.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Numerics.Vectors.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.Serialization.Json.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Private.DataContractSerialization.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.Serialization.Xml.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.Serialization.Primitives.dll
[monodroid-assembly] open_from_bundles: failed to load assembly mscorlib.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.SwipeRefreshLayout.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.CardView.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Maui.Controls.Compatibility.Android.FormsViewGroup.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.RecyclerView.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.ViewPager.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Fragment.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Activity.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Lifecycle.ViewModel.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Lifecycle.Common.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.SavedState.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.ViewPager2.dll
[libEGL] Emulator has host GPU support, qemu.gles is set to 1.
[libc] Unable to set property "qemu.gles" to "1": connection failed; errno=13 (Permission denied)
[RenderThread] type=1400 audit(0.0:5739): avc: denied { write } for name="property_service" dev="tmpfs" ino=8412 scontext=u:r:untrusted_app:s0:c148,c256,c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0 app=com.companyname.mauiapp_bugs
[libEGL] loaded /vendor/lib/egl/libEGL_emulation.so
[libEGL] loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Loader.dll
[libEGL] loaded /vendor/lib/egl/libGLESv2_emulation.so
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Xamarin.AndroidX.Loader.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.CoordinatorLayout.dll
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Xamarin.AndroidX.CoordinatorLayout.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Lifecycle.LiveData.Core.dll
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/Xamarin.AndroidX.Lifecycle.LiveData.Core.dll [External]
[me.mauiapp_bug] Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
[me.mauiapp_bug] Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
Thread started: .NET Timers #5
[me.mauiapp_bug] JIT allocated 70KB for compiled code of void android.view.View.<init>(android.content.Context, android.util.AttributeSet, int, int)
[HostConnection] HostConnection::get() New Host Connection established 0xdd94cf50, tid 26247
[HostConnection] HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_sync_buffer_data GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_2 
[EGL_emulation] eglCreateContext: 0xdd91a840: maj 2 min 0 rcv 2
[EGL_emulation] eglMakeCurrent: 0xdd91a840: ver 2 0 (tinfo 0xdd90f0f0)
[Gralloc3] mapper 3.x is not supported
[HostConnection] createUnique: call
[HostConnection] HostConnection::get() New Host Connection established 0xdd94d040, tid 26247
[HostConnection] HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_sync_buffer_data GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_2 
[eglCodecCommon] allocate: Ask for block of size 0x1000
[eglCodecCommon] allocate: ioctl allocate returned offset 0x3ffff8000 size 0x2000
[EGL_emulation] eglMakeCurrent: 0xdd91a840: ver 2 0 (tinfo 0xdd90f0f0)
[OpenGLRenderer] Davey! duration=1231ms; Flags=1, IntendedVsync=32986008512045, Vsync=32986008512045, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=32986023677280, AnimationStart=32986023714380, PerformTraversalsStart=32986023742680, DrawStart=32986765292080, SyncQueued=32986778731580, SyncStart=32986779523580, IssueDrawCommandsStart=32986779618080, SwapBuffers=32987132157980, FrameCompleted=32987241152980, DequeueBufferDuration=299000, QueueBufferDuration=364000, 
[Choreographer] Skipped 73 frames!  The application may be doing too much work on its main thread.
[OpenGLRenderer] Davey! duration=1268ms; Flags=0, IntendedVsync=32986025157946, Vsync=32987241824564, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=32987246464180, AnimationStart=32987247635180, PerformTraversalsStart=32987249389480, DrawStart=32987251343980, SyncQueued=32987252159780, SyncStart=32987252612880, IssueDrawCommandsStart=32987252686780, SwapBuffers=32987264323080, FrameCompleted=32987294447080, DequeueBufferDuration=53000, QueueBufferDuration=12336000, 
Thread started: <Thread Pool> #6
Thread started: .NET ThreadPool Gate #7
Thread started: <Thread Pool> #8
[monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.Intrinsics.dll
Loaded assembly: /data/data/com.companyname.mauiapp_bugs/files/.__override__/System.Runtime.Intrinsics.dll [External]
Thread started: <Thread Pool> #9
Thread started: <Thread Pool> #10
Thread started: <Thread Pool> #11
[AssistStructure] Flattened final assist data: 3276 bytes, containing 2 windows, 22 views
[EGL_emulation] eglMakeCurrent: 0xdd91a840: ver 2 0 (tinfo 0xdd90f0f0)
[EGL_emulation] eglMakeCurrent: 0xdd91a840: ver 2 0 (tinfo 0xdd90f0f0)
[EGL_emulation] eglMakeCurrent: 0xdd91a840: ver 2 0 (tinfo 0xdd90f0f0)
[EGL_emulation] eglMakeCurrent: 0xdd91a840: ver 2 0 (tinfo 0xdd90f0f0)
shimingsg commented 2 years ago

verified repro except the first scenario with vs 17.2.0 Preview 3.0 [32314.195.main] 5292-1

BinaryAssault commented 2 years ago

@shimingsg, can you double check the xaml for the radio buttons? Curious why the background color is to the right of the group. Maybe you accidentally discovered a workaround? Also in the same scenario, does clicking the SwitchCell cause the issue to occur?

Lastly, why does your keyboard not show when clicking an entry?

shimingsg commented 2 years ago

@BinaryAssault , I used the xaml in "Steps to Reproduce", please see the attached demo MauiApp5292.zip the scenario I did: click option 2 -> option3 -> option 1 -> entry 5292-2

BinaryAssault commented 2 years ago

It seems our emulators are of different APIs. I am using A10 and you're using A11. But even using A11, if I select one of the pickers or the SwitchCell, the radio button view cell disappears.

Example below is from A11 BrokenViewCells-SwitchCellA11

MissedSte4k commented 2 years ago

Related. ViewCell not only disappears when unfocused, it also fails to appear at all in some "advanced" cases. I'll reuse the code I used in this issue few weeks back. Just replace the xaml with this:

<ContentPage.Resources>
        <conv:InverseBoolConverter x:Key="inverseBool"/>
    </ContentPage.Resources>

    <ScrollView>
        <VerticalStackLayout>
            <TableView Intent="Settings" BackgroundColor="AliceBlue">
                <TableRoot>
                    <TableSection>
                        <ViewCell>
                            <Grid ColumnDefinitions="*, *" >
                                <Label Text="Use all sources:" />
                                <CheckBox  Grid.Column="1" IsChecked="{Binding UseAllNames}" x:Name="AllNamesCheckBox" />
                            </Grid>
                        </ViewCell>
                    </TableSection>
                </TableRoot>
            </TableView>
            <ListView ItemsSource="{Binding Names}">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <SwitchCell On="{Binding Selected}" Text="{Binding Value}" IsEnabled="{Binding On, Source={x:Reference AllNamesSwitchCell}, Converter={StaticResource  inverseBool}}"/>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
            <TableView Intent="Settings" BackgroundColor="AliceBlue">
                <TableRoot>
                    <TableSection>
                        <ViewCell>
                            <Grid ColumnDefinitions="*, *" >
                                <Label Text="Use all surnames:" />
                                <CheckBox  Grid.Column="1" IsChecked="{Binding UseAllSurnames}" x:Name="AllSurnamesSwitchCell" />
                            </Grid>
                        </ViewCell>
                    </TableSection>
                </TableRoot>
            </TableView>
            <ListView ItemsSource="{Binding Surnames}">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <SwitchCell On="{Binding Selected}" Text="{Binding Value}" IsEnabled="{Binding On, Source={x:Reference AllSurnamesSwitchCell}, Converter={StaticResource  inverseBool}}" >
                        </SwitchCell>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
        </VerticalStackLayout>
    </ScrollView>

And you will see, that the ViewCell does not appear at all image

If I play around with TableSelection at runtime (Hot Reload), I can make them appear (don't mind the ugly UI) image

Bowman74 commented 2 years ago

This may be an async timing issue. When I was running the emulator without a hypervisor the controls in the ViewCell would briefly show up. Sometimes it would disappear, sometimes it wouldn't, it was erratic.

When I enabled the hypervisor the emulator was much more performant and I didn't have problems with the ViewCell disappearing shortly after being drawn. It could be coincidence but it would explain why this always can't be reproduced.

It only seems to be an issue with the ViewCells. The SwitchCells don't disappear (nor the EntryCells I tested).

https://user-images.githubusercontent.com/4380198/171073026-42fc082b-3214-4ee5-b768-84b94de0b067.mp4

Edit to add: And now it's back. Here is my XAML.

<Grid ColumnDefinitions="150, *" RowDefinitions="50, 200, *">
    <Label Grid.Row="0" Grid.ColumnSpan="2" Text="Cat Question" FontSize="20" VerticalTextAlignment="Center" Margin="10, 0, 0, 0" />
    <AbsoluteLayout Grid.Row="1" Grid.Column="0">
        <Image Source="images/trouble_cat.jpg" Aspect="AspectFill" AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutBounds="0, 0, 1, 1" />
        <Label Text="Trouble Cat" HorizontalTextAlignment="Center" FontSize="20" AbsoluteLayout.LayoutFlags="PositionProportional,WidthProportional" AbsoluteLayout.LayoutBounds="0, 1, 1, 25" />
    </AbsoluteLayout>
    <Label Grid.Row="1" Grid.Column="1" Margin="10, 0, 0, 0" VerticalTextAlignment="Center" Text="How cute do you think this cat is?" />
    <TableView Grid.Row="2" Grid.ColumnSpan="2" RowHeight="50">
        <TableRoot>
            <TableSection>
                <SwitchCell Text="Meh, I've seen cuter" />
                <SwitchCell Text="That doesn't look like a dog" />
                <ViewCell>
                    <Grid ColumnDefinitions="*, 50" RowDefinitions="50">
                        <Label Grid.Row="0" Grid.Column="0" VerticalTextAlignment="Center" Text="SuperCute!" />
                        <RadioButton Grid.Row="0" Grid.Column="1" IsChecked="True" GroupName="Answer" BackgroundColor="Transparent" />
                    </Grid>
                </ViewCell>
                <ViewCell>
                    <Grid ColumnDefinitions="*, 50" RowDefinitions="50">
                        <Label Grid.Row="0" Grid.Column="0" VerticalTextAlignment="Center" Text="I can't believe how cute this cat is" />
                        <RadioButton Grid.Row="0" Grid.Column="1" GroupName="Answer" BackgroundColor="Transparent" />
                    </Grid>
                </ViewCell>
            </TableSection>
        </TableRoot>
    </TableView>
</Grid>
BinaryAssault commented 2 years ago

This may be an async timing issue. When I was running the emulator without a hypervisor the controls in the ViewCell would briefly show up. Sometimes it would disappear, sometimes it wouldn't, it was erratic.

When I enabled the hypervisor the emulator was much more performant and I didn't have problems with the ViewCell disappearing shortly after being drawn. It could be coincidence but it would explain why this always can't be reproduced.

It only seems to be an issue with the ViewCells. The SwitchCells don't disappear (nor the EntryCells I tested).

ViewCell.mp4 Edit to add: And now it's back. Here is my XAML.

<Grid ColumnDefinitions="150, *" RowDefinitions="50, 200, *">
    <Label Grid.Row="0" Grid.ColumnSpan="2" Text="Cat Question" FontSize="20" VerticalTextAlignment="Center" Margin="10, 0, 0, 0" />
    <AbsoluteLayout Grid.Row="1" Grid.Column="0">
        <Image Source="images/trouble_cat.jpg" Aspect="AspectFill" AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutBounds="0, 0, 1, 1" />
        <Label Text="Trouble Cat" HorizontalTextAlignment="Center" FontSize="20" AbsoluteLayout.LayoutFlags="PositionProportional,WidthProportional" AbsoluteLayout.LayoutBounds="0, 1, 1, 25" />
    </AbsoluteLayout>
    <Label Grid.Row="1" Grid.Column="1" Margin="10, 0, 0, 0" VerticalTextAlignment="Center" Text="How cute do you think this cat is?" />
    <TableView Grid.Row="2" Grid.ColumnSpan="2" RowHeight="50">
        <TableRoot>
            <TableSection>
                <SwitchCell Text="Meh, I've seen cuter" />
                <SwitchCell Text="That doesn't look like a dog" />
                <ViewCell>
                    <Grid ColumnDefinitions="*, 50" RowDefinitions="50">
                        <Label Grid.Row="0" Grid.Column="0" VerticalTextAlignment="Center" Text="SuperCute!" />
                        <RadioButton Grid.Row="0" Grid.Column="1" IsChecked="True" GroupName="Answer" BackgroundColor="Transparent" />
                    </Grid>
                </ViewCell>
                <ViewCell>
                    <Grid ColumnDefinitions="*, 50" RowDefinitions="50">
                        <Label Grid.Row="0" Grid.Column="0" VerticalTextAlignment="Center" Text="I can't believe how cute this cat is" />
                        <RadioButton Grid.Row="0" Grid.Column="1" GroupName="Answer" BackgroundColor="Transparent" />
                    </Grid>
                </ViewCell>
            </TableSection>
        </TableRoot>
    </TableView>
</Grid>

I'll have to disagree with you as this is still a failure on a physical android device for me. I tried on 3 different API levels and all did the same thing. Its a bummer that this is still a problem with GA as it really inhibits the ability to make a simple settings page. I have to either create a custom control to handle all my settings or breakout a slew custom XAML per setting to get the look of a table.

All I want is the ability to use a picker in settings, which requires a ViewCell; but I can't do that.

SophisticatedConsulting commented 2 years ago

Please can this be fixed? It is a showstopper for MAUI migration - I cannot use ViewCells on Android (which work fine in Xamarin) and as @BinaryAssault comments there is no alternative to render many controls such as picker within a table, or to, for example render a grid within a table. @Redth why is this no longer a P1? I have the impression that GA for MAUI was premature with many breaking issues unresolved and an unrealistic timetable for Xamarin support ending when migration to MAUI is not feasible.

ghost commented 2 years ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

SophisticatedConsulting commented 2 years ago

It is really poor this is not being fixed. ViewCell does not work in maui and is a showstopper for migration. Please prioritise fixing critical maui bugs that stop migration over new features.

ewerspej commented 2 years ago

Being able to use ViewCells is important when using TableViews for Settings Pages.

ArielHashuel commented 2 years ago

I Was able to solve using <TableView HeightRequest="700"> or any other large number. I'm not sure how it will work on larger screens. Maybe the problem has something to do with the TableView or ViewCell Height property

BinaryAssault commented 2 years ago

I Was able to solve using <TableView HeightRequest="700"> or any other large number. I'm not sure how it will work on larger screens. Maybe the problem has something to do with the TableView or ViewCell Height property

Interesting, the HeightRequest indeed does work to fight the issue. But that shouldn't be required.

On the same line, I tried setting VerticalOptions and MinimumHeightRequest and neither of those worked. I also tried a height on the ViewCell itself without any luck.

ewerspej commented 2 years ago

Setting the HeightRequest for the entire control is not a solution, because in most scenarios, you don't know what the Height needs to be. This issue should be worked on rather soon, otherwise TableView is not a useful control. I would strongly disagree with using this "workaround" as an excuse to not fix this bug.

jahmai-ca commented 1 year ago

I Was able to solve using <TableView HeightRequest="700"> or any other large number. I'm not sure how it will work on larger screens. Maybe the problem has something to do with the TableView or ViewCell Height property

Thank you, this unblocked my MAUI migration.

abastias commented 1 year ago

Any Update on the final solution?

YiannisBourkelis commented 1 year ago

Same issue here with disappearing controls and other layout bugs when using a tableview with custom viewcells.

YiannisBourkelis commented 1 year ago

@Redth @hartez @davidortinau We run into similar issues with the tableview and custom viewcells. We are in a process of migrating a Xamarin.Forms project to MAUI and any page that uses a tableview has issues as the one described here with disappearing controls.

Here is a very simple reproducible case https://github.com/YiannisBourkelis/maui_issues/tree/main/src/TableViewDisappearingControlsIssue Run it on Android/iOS/MacCatalyst and you will se that the label does not appear. Changing the label control to an Entry and you will discover more issues.

Tableviews are very essential part of any mobile app and should work as expected. Please let me know if I can provide more examples of the issues we are experiencing with the tableview so that you can easily identify these issues.

SophisticatedConsulting commented 1 year ago

The workaround, e.g. HeightRequest="{OnPlatform Android=700}" ...does not resolve the issue, depending on the screen content, the layout affects can be very strange, including exposing the underlying screen when a modal dialogue is displayed with a TableView. @davidortinau please can this be prioritised, as you can see from the above it is a blocker for Xamarin -> maui migration for many. Much appreciated.

ketakidevendra commented 1 year ago

This is really a showstopper. Any update on this?

BinaryAssault commented 1 year ago

This is in no way a solution for this, but I ran across this repo here which provides a fully functional settings view. This will allow a functional settings page. It is in preview, so use at your own risk. It's more functional than the native MAUI TableView

EgonRasmussen commented 1 year ago

I have success with the HasUnevenRows="True" on the TableView, see the dokumentation Size Items:

<TableView Intent="Settings" HasUnevenRows="True">
    <TableRoot>
        <TableSection Title="Silent">
            <ViewCell>
                <Grid ColumnDefinitions="0.5*,0.5*" RowDefinitions="Auto,Auto">
                    <Label Margin="10,10,0,0" Text="Vibrate" />
                    <Switch Grid.Column="1" HorizontalOptions="End" />
                    <Slider
                        Grid.Row="1"
                        Grid.ColumnSpan="2"
                        Margin="10"
                        Maximum="10"
                        Minimum="0"
                        Value="3" />
                </Grid>
            </ViewCell>
        </TableSection>
    </TableRoot>
</TableView>
TableView
XamlTest commented 1 year ago

Verified on Visual Studio Enterprise 17.6.0 Preview 3.0. This issue repro except the first scenario on Android emulator (13.0-API 33) with below Project: 5292.zip

hansmbakker commented 1 year ago

This seems related to

It seems to be affecting many users as it is a basic usecase.

@davidortinau @jfversluis @Redth can you please put a priority on this again to fix this? It was prioritized as p1 before by @davidortinau and then dropped again...

Also some feedback - the transparency to customers is really low here - it was triaged/verified more than a year ago

image

then it was prioritized

image

and then put on the backburner without an explanation or suggested workaround.

What I am really missing is transparent communication on these points:

For customers, having to make a guess based on tags that can seemingly be added or removed arbitrarily is difficult, and it does not instill confidence in how Maui bugs are treated.

jfversluis commented 1 year ago

@hansmbakker appreciate the feedback, but I don't think this is the place for it. This will only steer this issue potentially off-topic which will not really help getting this resolved any sooner.

alexcheer-dts commented 1 year ago

Confirming bug still exists on VS2022 LTSC 17.4.11 with maui-android 7.0.92/7.0.100 and android 33.0.68/7.0.100 workloads installed.

If it's any help, I've been developing using an actual device, a Samsung Galaxy A52 running Android 13 with September security updates. Issue persists on other android devices used for testing as well.

fx999dev commented 1 year ago

Still not working on .NET 8, with Visual Studio Preview 17.8.0 Preview 2.0

SliemBeji-FBC commented 1 year ago

Aswell not working on .net 7 VS 17.7.5

Bennynation commented 11 months ago

Hi everyone ! I think i found an interesting workaround for this problem ! I took the OnMeasure from the PlatformRenderer : https://github.com/dotnet/maui/blob/8e933a7a7a46fdb586918e7414345d978cb0878d/src/Compatibility/Core/src/Android/PlatformRenderer.cs#L79

This is the workaround i found :

public class MyTableViewHandler : TableViewRenderer
    {
        public MyTableViewHandler(Context context) : base(context)
        {
        }

        //Do not call base.OnMeasure(widthMeasureSpec, heightMeasureSpec); !!!
        protected override void OnMeasure(int widthMeasureSpec, int heightMeasureSpec)
        {
            int width = MeasureSpec.GetSize(widthMeasureSpec);
            int height = MeasureSpec.GetSize(heightMeasureSpec);

            SetMeasuredDimension(width, height);

            for (int i = 0; i < ChildCount; i++)
            {
                Android.Views.View child = GetChildAt(i);
                child.Measure(MeasureSpec.MakeMeasureSpec(width, MeasureSpecMode.Exactly),
                    MeasureSpec.MakeMeasureSpec(height, MeasureSpecMode.Exactly));
            }
        }
    }
public static class MauiProgram
{
    public static MauiApp CreateMauiApp()
    {
        var builder = MauiApp.CreateBuilder();
        builder
            .UseMauiApp<App>()
            //...
            .ConfigureMauiHandlers((handlers) =>
            {
#if ANDROID
                handlers.AddHandler(typeof(TableView), typeof(MyTableViewHandler));
#endif
            });

        //...

        return builder.Build();
    }
}
programatix commented 11 months ago

MAUI .NET 7, VS 17.8.2, ViewCell content blanked out (Android only) with the following actions,

  1. Tap on the Swith in SwitchCell
  2. Switch theme via Application.Current.UserAppTheme = AppTheme.xxx

Both of the above are resolved by using workaround https://github.com/dotnet/maui/issues/5292#issuecomment-1804531480.

Cybrosys commented 11 months ago

@Bennynation thank you for the workaround! I've been going crazy with the TableView. I 100% use custom layouts as my view cells and as soon as they update their layout, everything just disappears. There are so many issues reported for this same thing.

ewerspej commented 10 months ago

@Cybrosys That's why I stopped using it in favor of StackLayouts with custom components.

Cybrosys commented 10 months ago

@Cybrosys That's why I stopped using it in favor of StackLayouts with custom components.

I was doing something similar, but I went back to TableView as I wanted the default touch/tap effects.

PureWeen commented 7 months ago

This should be fixed on SR2 by https://github.com/dotnet/maui/pull/20130