[TIMOB-19754] Android Textfield is not vertically aligned at center
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2017-05-03T08:22:49.000+0000 |
Affected Version/s | Release 5.0.1, Release 5.0.2, Release 5.0.0 |
Fix Version/s | n/a |
Components | Android |
Labels | android, regression, texfield |
Reporter | Ricardo Ramirez |
Assignee | Gary Mathews |
Created | 2015-10-20T20:23:24.000+0000 |
Updated | 2018-08-06T17:37:00.000+0000 |
Description
Issue Description
Text field text is not align centered in Android using the Titanium SDK 5.X, Is working good in Titanium SDK 3.5.1. verticalAlign: Ti.UI.TEXT_VERTICAL_ALIGNMENT_CENTER -> also is not working.Steps to replicate:
-Create a new titanium classic project -Open the app.js file inside Resources -Replace the code with this:
var win = Ti.UI.createWindow({
backgroundColor: 'white'
});
var textField = Ti.UI.createTextField({
borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
color: '#336699',
backgroundColor: "red",
top: 10, left: 10,
width: 250
});
win.add(textField);
win.open();
Attachments
File | Date | Size |
---|---|---|
4.4.4.png | 2015-10-29T22:14:24.000+0000 | 53561 |
5.0.0.png | 2015-10-29T22:14:24.000+0000 | 62894 |
Device-Nexus4-21-TIMOB-19754.png | 2015-11-25T08:31:46.000+0000 | 25247 |
latest_SS.png | 2015-11-30T19:19:10.000+0000 | 136576 |
nexus4-23-TIMOB-19754.png | 2015-11-25T08:24:31.000+0000 | 246512 |
Nexus4-ALLCAPS.png | 2015-12-01T07:18:48.000+0000 | 30658 |
Ti.UI.TEXT_VERTICAL_ALIGNMENT_CENTER is working fine. If you want your text to appear in the center of the textfield, you should use:
Hello [~hpham] I want to center the text vertically, please see the attached screenshots. The textAlign: Ti.UI.TEXT_VERTICAL_ALIGNMENT_CENTER is working on Android 4 [4.4.4.png screenshot] but is not working on Android 5 [5.0.0.png screenshot], the textAlign: Ti.UI.TEXT_ALIGNMENT_CENTER property just center the text horizontally. This is happening in ally and classic, here is my test-case in classic:
[~rramirez], I checked the above test case and it works fine on Nexus 4 device and emulator. See attached screen shots. Please let me know if I am missing anything.
Nope, but you are running the app using the API 23 and I think that I was using the API 21, let me update my environment and try again using the 5.1.1.GA SDK and the API 23. I will keep you updated about the results. Thanks.
Hello ! I have tested using Genymotion emulating a Google Nexus 7 with Android 5.0.0 API 21and SDK 5.1.1.GA. Please Try typing Uppercase letters too. A new Screenshot is attached[latest_SS.png]
[~rramirez] Not able to the issue. Attached screenshot [Nexus4-APPCAPS] which is working as expected! Can you do two things 1. Try running on a device/emulator - not Genymotion. 2. Run at least on Android 5.1. Because as I am trying to see similar occurrences I found someone reporting an alignment issue on early versions of lollipop. https://code.google.com/p/android/issues/detail?id=87795
Tested with 4.4.2, 5.0.1, 5.1.1, and 6.0. This is only reproducible in 5.0.1. However, Lollipop is known for font rendering and misalignment issues. Google fixed this in 5.1. Closing this ticket as not our bug. Please open if you can reproduce this on devices that are NOT 5.0.x.
Do we have a specific bug from Google/Android in reference to alignment issues? I would like to reference that here.
Not able to find specific bug report but here are few references to this issue https://code.google.com/p/android/issues/detail?id=87795 http://stackoverflow.com/questions/27945834/android-5-0-lollipop-is-not-displaying-special-characters-correctly
This is definitely a Titanium issue Create a native Android project and add:
[~nsalahin] try Android OS 5.0.0 and Android OS 5.1.0
Hello, Thanks for your contribution. I have tested that issue you reported. In titanium SDK 5.2.0 GA, the property “*verticalAlign:Ti.UI.TEXT_VERTICAL_ALIGNMENT_CENTER*” is working as expected in android 5.1.0 but doesn’t work in android 5.0.0. Please check [5.1.0| http://postimg.org/image/urmzqqyz1/], [5.0.0](http://postimg.org/image/evdj3i9k9/). *Test Environment:* Appcelerator Studio, build: 4.5.0.201602170821, Operating System Mac OS X -EI Capitan,Versio-10.11.1, Appcelerator Command-Line Interface, version 5.2.0, SDK Version = 5.2.0.GA, Node.js Version: 4.2.2 npm Version:2.14.7, Emulator: Custom phone / android 5.0.1, Nexus 5/ android 5.0.0 Thanks.
Any idea how I can get this working on Android 5.0.x? Theme-configuration or something?
This is still an issue with the latest 5.5.1.GA as well as latest 6.x.x SDK's. Is this issue even being worked on? Also, are there any alternatives/workarounds.
So this does appear to be an Android issue, and it depends on the type of view the TextView is added to: https://code.google.com/p/android/issues/detail?id=59700 https://code.google.com/p/android/issues/detail?id=59368
Resolving as invalid as this is not our bug.
Closing as invalid. If incorrect, please reopen.