Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 1593 [details]
Text that is read into StreamReader.
When I read in a text document and display the content in a MultilineElement it cuts off the last line.
sr = new StreamReader("Terms.txt");
string termText = sr.ReadToEnd();
RootElement terms = new RootElement("Terms and Conditions");
Section termSection = new Section(String.Empty);
MultilineElement element = new MultilineElement(termText);
The text file is attached.
I am not sure about the exact version number of Monotouch but I know it is the latest stable release.
FYI the MonoTouch version number is shown in MonoDevelop "Application Output" pad on each build.
You can also get it (along with the build #) from the terminal using the following command.
Finally the most useful is to get it from "MonoDevelop" menu, "About MonoDevelop" item, "Version Info" tab and copy/paste the version informations (at least down to the "Loaded assemblies" section).
The version is 5.2.10, thanks.
There's something wrong with the multi-line computations.
The two last words "written permission." are cut from the element when executed on an iPod/iPhone.
However the element is twice the required height when executed on an iPad.
The issue (for iPod/iPhone) seems to be that the size computation uses "Helvetica" 17.0 for font while the TextLabel.Font is using "Helvetica-Bold" 17.0. Changing the computation to Bold fix the issue (at least for this case).
The width is hardcoded to 280 pixels when calculating :-) so this expand the height by about 2. I'll cook a patch for both cases later (after diner :-)
Thanks for the report!
This fix the font (calculated versus rendered), margin difference (iPad versus iPhone) and orientation issues I found.
diff --git a/MonoTouch.Dialog/Elements.cs b/MonoTouch.Dialog/Elements.cs
index ee30808..c6dd278 100644
@@ -1017,8 +1017,9 @@ namespace MonoTouch.Dialog
public virtual float GetHeight (UITableView tableView, NSIndexPath indexPath)
- SizeF size = new SizeF (280, float.MaxValue);
- using (var font = UIFont.FromName ("Helvetica", 17f))
+ float margin = UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone ? 40f : 110f;
+ SizeF size = new SizeF (tableView.Bounds.Width - margin, float.MaxValue);
+ using (var font = UIFont.FromName ("Helvetica-Bold", 17f))
return tableView.StringSize (Caption, font, size, UILineBreakMode.WordWrap).Height + 10;
The patch from bug #3529 is a superset of this one.
I'm currently using the built in Monotouch.Dialog library, do I now need to use the outside one to implement this patch? If not how do I incorporate it?
Fixed with the patch from bug #3529
Justin, you can either:
a) update to MonoTouch 5.2.11 (stable) when available (or 5.3.3 unstable);
b) use the MT.D code from GIT (the patch for #3529 is already there, 03966b49606e7f1a3cc6a4e8f97c7ba12f5e160c); or
c) you can create your own, e.g. MyMultilineElement, and override GetHeight to use the code from comment #7.
*** This bug has been marked as a duplicate of bug 3529 ***