Bug 22491 - StringElement is useless
Summary: StringElement is useless
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: master
Hardware: PC Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2014-08-28 21:26 UTC by yxy332
Modified: 2016-05-25 00:57 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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.

Related Links:

Description yxy332 2014-08-28 21:26:05 UTC
I use MTD to build a simple view in my project, and I set every element to UITextAlignment.Center. <br />
But it seems that StringElement always align its value to right, it doesn't have TextAlignment property, and its Alignment Field not works. <br />
I think it is a bug, if not, why you public its Alignment Field? <br />
BTW, StringElement won't trigger a redraw when I change its Value(Value here is a Field not Property), do you think StringElement is a const Element?
Comment 1 Arpit Jha 2014-09-01 08:02:45 UTC
I have tried to reproduce this issue but unable to reproduce.

I have tried following steps
1.Create an ios application.
2. Add a  Button using  stringElement in Appdelegate.cs
3. Set  Button Alignment to the right,center or left.

	var loginButton = new StringElement ("Login click btn", delegate {
				login.FetchValue ();
				pass.FetchValue ();
				if (login.Value == "Root" && pass.Value == "Root"){
					NSUserDefaults.StandardUserDefaults.SetBool (true, "loggedIn");
					window.RootViewController.PresentViewController (MakeOptions (), true, delegate {});

			loginButton.Alignment = UITextAlignment.Center;

I observed that  StringElement  Alignment property  is working fine

Screencast:  http://screencast.com/t/ataRbWGB

please let me know if i have to follow another steps to reproduce it.

Environment Info:
=== Xamarin Studio ===

Version 5.3 (build 439)
Installation UUID: 2939b8b4-8977-42bd-82d6-100275ccd9cd
	Mono 3.8.0 ((no/356dbc5)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 308000010

=== Apple Developer Tools ===

Xcode 5.0 (3332.22)
Build 5A1412

=== Xamarin.iOS ===

Version: (Business Edition)
Hash: 77efa3f
Build date: 2014-08-26 07:59:55-0400

=== Xamarin.Android ===

Version: 4.16.0 (Business Edition)
Android SDK: /Users/360_macmini/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

=== Xamarin.Mac ===


=== Build Information ===

Release ID: 503000439
Git revision: cc6857ea9e1f0a9b73ae91ba2651bbd65bb025d2
Build date: 2014-08-28 04:44:10-04
Xamarin addins: 64abcc2ff237e90e590aee75625f60badbbdb2c1

=== Operating System ===

Mac OS X 10.9.0
Darwin 360-MACMINIs-Mac-mini-2.local 13.0.0 Darwin Kernel Version 13.0.0
    Thu Sep 19 22:22:27 PDT 2013
    root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64
Comment 2 Sebastien Pouliot 2016-05-25 00:57:04 UTC
We have never been able to reproduce the issue.

If you are still experiencing this issue please provide all the requested information and re-open the bug report. Thanks!