-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EntryElement Caption overlaps the TextField #230
Comments
Would love to see this fixed as well. Part of the problem is that the GetCell method creates a UITableViewCell and also creates and modifies the UITextField. All of the UITextField related things should be happening in that cell instead of the EntryElement.GetCell method. Alternatively, allowing for specifying of a custom cell class to use for creation would be a great thing not only for the EntryElement, but all of the elements. |
@danmiser Im curious what would be a good fix for this. If the label was truncated, it still is a strange thing to present to a user. The real issue is the text is too long. Replacing an overlap with a truncation doesnt really help present the data better. What would work better? |
This was a real issue for me, I solved it by adding a parameter to entry element called xPos it tells the control where to start the entry element, totally solved my problem. nfloat sizeWidth = size.Width; This works really well for me, I added this to all the appropriate elements. hope it helps. |
I think the real solution is to have a custom UITableViewCell for each element. Here's one implementation: I also found this as a good starting point, but the code is so old that it would have to have some extensive rework to be sure that all of the core MTD code is in there as well: By doing this, we separate what is in the cell from the element. It would be great to be able to extend things in our code but it's more of a copy/paste from the code right now due to the high cohesion of the code. I agree with you about the size of the labels being the real problem. But the entry element is just unusable as it is right now with long captions. At least truncation would allow a clean experience. The reason it is an issue for me is the captions are coming from user defined values. If it was just me making the labels, I'd shorten them, but I don't have control over that. |
This is still a problem with the current build of MTDialog. I've resolved it by inheriting from EntryElement to create a new FixedEntryElement class that overrides the GetCell() method. It gives the label a third of the width and the text entry two thirds. It works consistently from initial display and across refreshes. In addition to adding this class to your project, you'll also need to change the EntryElement class source (in Elements.cs) to make these variables accessible and overridable from your descendant class.
I moved these all from their original locations in the EntryElement class to one spot so that I'll know what changes need to be made again if I update Elements.cs in the future. Once you've made the variables available, create and use this class instead of EntryElement. Note that GetCell() here is so long because it is essentially re-implementing exactly what's done in EntryElement GetCell(). The primary difference is near the top of GetCell() where the size and width variables are defined.
|
When the Caption of an EntryElement is long, instead of truncating, it overlaps the text field.
The text was updated successfully, but these errors were encountered: