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 123 [details]
Screenshot of issue
When creating a UITextField with a frame from code behind it does not properly align the text or the placeholder. I'm not sure if this is due to the bug in #265 but I figured I would report it. Note that it doesn't matter if you set a placeholder or text value either way will cause the misalignment. Also note that this behavior is in the Simulator. I'm not sure if it acts the same on the device yet.
Steps to reproduce.
1. Create a xib and add a UITextField to it and just set a placeholder.
Leave all defaults except the width which I set to 200 for both contols.
2. In code do the following.
// height of 31 below to match xib default.
var textField = new UITextField(new RectangleF(0, YValue, 200, 31);
textField.Font = UIFont.FromName("Helvetica", 12); // to match xib
textField.Placeholder = "Code Generated";
Attached is a screenshot of the results.
I forgot to mention in step 2 to set the BorderStyle to RoundedRect to match xib.
Nevermind. It appears the VerticalAlignment when creating UITextField from code behind defaults to top instead of center.