C# Xamarin/Monotouch.Dialog - EntryElement Not Displaying Entered Characters
Asked Answered
E

4

8

I have a Monotouch.Dialog EntryElement.

Occasionally when I start typing, nothing shows up...

The cursor does not display, and if I type text, it cannot be seen, but it does get persisted to the EntryElement.Value property.

The problem seems to be only on the iPhone itself, but not on the iOS Simulator. I'm running iOS 6.3

Any ideas? This pretty much writes off Monotouch for me if I can't have a consistent user experience.

Entertainer answered 16/7, 2013 at 19:22 Comment(2)
same problem here, any updated about this?Lions
Nothing. I've scrapped using Monotouch.Dialog completely and moved to rolling my own custom controls for everything.Entertainer
S
2

At Xamarin bug tracking system Bug 7398 is the situation you described.

But it is version 5.4 of iOS and on 5.2 it works fine.

Also Bug 7116 describes the same issue but this time it wasnt Xamarins bug.

My suggestion to you is to post you issue as a bug at bugzilla.xamarin.com.

Plese you the sample I have provided above to write you bug report correctly.

Sulfuric answered 26/7, 2013 at 6:53 Comment(0)
L
0

Just a work around that do the job for me:

//FIXME: this is a workaround  about a bug relative to the position of TextBox element
// https://bugzilla.xamarin.com/show_bug.cgi?id=7398
var tmp = new EntryElement ("a", "a", "a");

I've added this code to the very first View on my application and the problem is gone.

I hope that helps to others.

Lions answered 3/8, 2013 at 4:11 Comment(2)
How exactly does this work though? Your object declaration looks the same as the standard EntryElement declaration that is causing the problem....Entertainer
Adding that code on the very first view solved my problem. I'm not using the tmp EntryElement variable. In my case, I think there are some initialization tasks where not executed and are important to the correct text measures in order to display the control in the forward views, so adding this code I'm forcing that executions. Try that and to tell us if it works for you.Lions
I
0

It sounds like you are running across a bug. The only solution that has actually worked for me is to subclass EntryElement, and call the FetchValue(); method in the constructor. Here is an example:

public SAEntryElement (string caption, string placeholder, string value) : base(caption, placeholder, value)
    { 
        // HACK: A workaround in an attempt to stop the bug where the value field would be empty sometimes
        FetchValue();
    }

I have not been able to make a reliable test case to put on Xamarin's bugzilla, and I didnt have time to fight it any longer. Since I have implemented this workaround, the problem is gone on both the simulator and device for a few months now. Also note there is a similar symptom for a known bug related to empty strings as Captions (seperate problem).

Igorot answered 13/8, 2013 at 16:59 Comment(0)
A
0

With the help of MikroDel's answer and the comments in bugzilla for the bug 7398, the problem for me was that the Height of the EntryElement was 0.

Setting it to the desired value (bigger than 0) fixed the problem.

Alcaeus answered 16/12, 2013 at 9:32 Comment(2)
This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post.Inculpable
I'm sorry if I did something wrong, I just had the exact same problem, and this was the solution, so I just wanted to help.Alcaeus

© 2022 - 2024 — McMap. All rights reserved.