Bug 37199 - [Android] Issue with Custom Renderer for Entry
Summary: [Android] Issue with Custom Renderer for Entry
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.0.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Chris King
Depends on:
Reported: 2015-12-21 16:05 UTC by Anubhav Ranjan
Modified: 2017-06-19 21:06 UTC (History)
6 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 Anubhav Ranjan 2015-12-21 16:05:18 UTC
Using Custom Renderer for Entry in Android, ignores the GravityFlag set for EditText.

Somehow, setting the value like this, is ignored the second time the EditText is in focus.
EditTextField.Gravity = GravityFlags.Right


Expected Result:
The cursor should always appear on the Right side.

Actual Result:
First time the cursor appears on the Right side but, later on, it is found to be on the Left side.

I am using custom renderers for Entry control which horizontally aligns content(Text of Entry) to right side in iOS and Android but left on Windows Phone.

It works perfectly fine on iOS and Windows Phone but not on Android.
It puts the text into the right side when control is loaded. Hide the control and then reload it and content will adjust itself to left on Android.


#Version Information:
Microsoft Visual Studio Enterprise 2015
Version 14.0.24720.00 Update 1
Microsoft .NET Framework
Version 4.6.01055

Installed Version: Enterprise

Architecture and Modeling Tools   00322-80000-00000-AA394
Microsoft Architecture and Modeling Tools
UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.

Visual Basic 2015   00322-80000-00000-AA394
Microsoft Visual Basic 2015

Visual C# 2015   00322-80000-00000-AA394
Microsoft Visual C# 2015

Visual C++ 2015   00322-80000-00000-AA394
Microsoft Visual C++ 2015

Windows Phone SDK 8.0 - ENU   00322-80000-00000-AA394
Windows Phone SDK 8.0 - ENU

Application Insights Tools for Visual Studio Package   1.0
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015.1 (Beta8)   14.1.11106.0
ASP.NET and Web Tools 2015.1 (Beta8)

ASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.30624.0
For additional information, visit http://www.asp.net/

Common Azure Tools   1.5
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

NuGet Package Manager   3.3.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   14.0.50616.0
Microsoft SQL Server Data Tools

TypeScript for Microsoft Visual Studio

Xamarin (1390b70)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android (d300845)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS (ea30b32)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 2 Chris King 2017-01-05 00:47:56 UTC
Why not allow the underlying Entry renderer to align the text by setting BorderlessEntry HorizontalTextAlignment="End"? 

In general, custom renderers are a bit of black art; getting the right is tricky. Even then it is challenging for XFT to anticipate (for testing) the many possible custom renderers customers may create. Therefor we suggest using the existing renderers when possible. For our part, we try to expand the existing renderers to incorporate functionality that forces a large portion of our users to resort to custom renderers. So, if you'd like, you can post to the forums a suggestions for Entry renderer functionality else please try the suggestion above.

Warm regards,
Comment 3 Chris King 2017-06-19 17:09:27 UTC
Assigned to you as you were last to requeste info for this bug.
Comment 4 Samantha Houts [MSFT] 2017-06-19 21:06:31 UTC
Because we have not received a reply to our request for more information we are closing this issue. If you are still encountering this issue, please reopen the ticket with the requested information. Thanks!