Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1195] android:anyDensity="false" usage gives too much extra padding to TextFields

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionCannot Reproduce
Resolution Date2014-09-01T06:47:34.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAlloy, Titanium SDK & CLI
LabelsTCSupportTriage, android
ReporterVishal Kumar Singh
AssigneeMauro Parra-Miranda
Created2014-08-06T01:37:17.000+0000
Updated2016-03-08T07:37:34.000+0000

Description

#Background: Noticed that in the Kitchen Sink app the textfields looks just fine, but in the app I was developing had this good amount of padding applied to it due to which my text in the textfields were not visible. Solved it by using height: Ti.UI.SIZE, but that made my textfields look huge. There was no way to improve it as padding control is not given to the textfields. #Investigation Finding After removing from my tiapp.xml fixed the issue of removing that additional padding.

Comments

  1. Mostafizur Rahman 2014-08-10

    Hello, We have tested this issue with our sample code. We have used in tiapp.xml and also remove this from tiapp.xml, but there is no any effect on textfield padding. *TESTING ENVIRONMENT:* Titanium SDK: 3.3.0.GA and 3.2.3.GA Titanium CLI: 3.3.0 OS X Version: 10.9.3 Android API Level: 17 and 19 *STEPS TO REPRODUCE:* a) Create a simple alloy project. b) Update this code in index.js , index.xml and tiapp.xml c) Run this with testing environment *TESTING CODE:* Index.xml
    <Alloy>
           <Window id="win" backgroundColor="white">
               <TextField id="textField" backgroundColor="red" borderStyle="Ti.UI.INPUT_BORDERSTYLE_ROUNDED" color="#336699" top="10" left="10" width="300"  />
           </Window>
       </Alloy>
    Also using height: Ti.UI.SIZE,
    <Alloy>
           <Window id="win" backgroundColor="white">
               <TextField id="textField" backgroundColor="red" borderStyle="Ti.UI.INPUT_BORDERSTYLE_ROUNDED" color="#336699" top="10" left="10" width="300" height= "Ti.UI.SIZE" />
           </Window>
       </Alloy>
    Index.js
    $.win.open();
    Tiapp.xml Add and remove bellow code in tag
    <supports-screens android:anyDensity="false"/>
    *TESTING RESULT:* There is no change in TextField. Thanks.
  2. Mauro Parra-Miranda 2014-09-01

    Please take a look into the testcase. If you can still reproduce the issue, please add your testcase so we can reproduce.
  3. ian young 2014-09-09

    I'm seeing this same issue with HUGE (sometimes more than 20px) padding given to all my textfields, for various Android devices (Galaxy S4 and above display the most padding). Will add a test case once I've figured out a hacked fix because the App is due for release today.
  4. Lev 2014-11-10

    That issue is connected with TIMOB-16512 and is a big pain for some android devices (HTC One with Android 4.4.3 in my case) - textboxes become just not functioning at all (probably because of default padding values and/or anyDensity=false).
  5. Lev 2014-11-27

    Excessive textfield internal padding could be eliminated by specifying style for EditText: Checked for classic app. See how to introduce custom style for Android http://docs.appcelerator.com/titanium/3.0/#!/guide/Android_Themes

JSON Source