I am facing the issue of formatting a simple textfield in Titanium Android.
Problem : I am not able to view the text field input value that I enter. If I print the logs its getting entered but not visible. In some devices I get cut-off text.
Below is my code :
In my .js file I have textfield as follows :
var t1 = Titanium.UI.createTextField({
value : Titanium.App.Properties.getString("userID"),
left : 130,
top : 25,
height : 30,
width : 140,
color : 'black',
font : {
fontSize : 12
},
borderStyle : Titanium.UI.INPUT_BORDERSTYLE_ROUNDED
});
In my tiapp.xml file :
<android xmlns:android="http://schemas.android.com/apk/res/android">
<manifest>
<application android:theme="@style/Theme.Titanium"/>
<supports-screens android:anyDensity="false"
android:largeScreens="false"
android:normalScreens="false" android:resizeable="false"
android:smallScreens="false" android:xlargeScreens="false"/>
</manifest>
</android>
Solution tried : I tried the solution provided in the link:
It says that you need to set height of TextField to "Ti.UI.SIZE" + add <supports-screens android:anyDensity="true"/>
in your tiapp.xml file + add <property name="ti.ui.defaultunit">dp</property>
in your tiapp.xml file.
If I set height of textfield as "Ti.UI.SIZE" it shows the input value but the height of textfield becomes too large for the screen because I have multiple textfields in my particular screen and it looks too weird with this height.
Any help will be appreciated.
Thanks.
Update : Issue is observerd in Android 4.4.4 and 5.0 OS.For other, its working fine.