Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20450] Android: Font in textfield isn't vertically aligned properly so it will fall off screen with a bigger font

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionInvalid
Resolution Date2019-12-04T23:38:44.000+0000
Affected Version/sRelease 5.1.2
Fix Version/sn/a
ComponentsAndroid
LabelsengTriage, texfield
ReporterRene Pot
AssigneeUnknown
Created2016-02-19T12:20:41.000+0000
Updated2019-12-04T23:38:44.000+0000

Description

I have a textfield with 28dp height, and the fontSize of the textfield is 14dp. (14sp gives same result) Attached is a screenshot of the result. It doesn't align properly and you can't see the top part of the string

Attachments

FileDateSize
Screen Shot 2016-02-19 at 12.18.37.png2016-02-19T12:13:19.000+00008860

Comments

  1. Miguel Ángel Castaño 2016-02-19

    I have the same problem. Always Android 5.X.
  2. Rene Pot 2016-02-19

    Good to notice indeed. My 5.0.2 and 5.1 I mentioned are Ti.SDK
  3. Sharif AbuDarda 2016-02-22

    Hello [~topener], Try a textfield without setting a height. The textField height will automatically set according to the font size. Thanks.
       var textField = Ti.UI.createTextField({
         borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
         color: '#336699',
         borderColor : '#000',
         backgroundColor : 'transparent',
         top: 100, left: 10,
         width: 250,
         font: { fontSize: '14dp' },
       });
       
  4. Rene Pot 2016-02-23

    Thanks, but that only works sometimes. This does require the textfield to be taller/higher than actually intended.
  5. Alan Hutton 2019-12-04

    After speaking to Rene, closing as invalid.

JSON Source