i facing issue of formatting simple textfield in titanium android.
problem : not able view text field input value enter. if print logs getting entered not visible. in devices cut-off text.
below code :
in .js file have textfield 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 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 : tried solution provided in link:
it says need set height of textfield "ti.ui.size" + add <supports-screens android:anydensity="true"/>
in tiapp.xml file + add <property name="ti.ui.defaultunit">dp</property>
in tiapp.xml file.
if set height of textfield "ti.ui.size" shows input value height of textfield becomes large screen because have multiple textfields in particular screen , looks weird height.
any appreciated.
thanks.
update : issue observerd in android 4.4.4 , 5.0 os.for other, working fine.
finally, solved using custom theme named mytheme.xml added under platform folder--> android folder --> res folder--> values folder --> mytheme.xml
in mytheme.xml :
<?xml version="1.0" encoding="utf-8"?> <resources> <!-- define theme using appcompat.light theme base theme --> <style name="theme.mytheme" parent="@style/theme.titanium"> <!-- titanium sdk 3.2.x , earlier, use holo.light or light theme <style name="theme.mytheme" parent="@android:style/theme.holo.light"> --> <item name="android:edittextstyle">@style/edittext</item> </style> <style name="edittext" parent="@android:style/widget.edittext"> <item name="android:textcursordrawable">@null</item> <item name="android:textcolor">#000000</item> <item name="android:paddingleft">10dp</item> <item name="android:paddingright">10dp</item> <item name="android:background">#ffffff</item> <item name="android:gravity">center_vertical</item> <item name="android:layout_width">wrap_content</item> </style> </resources>
in tiapp.xml:
under android tag :
<android xmlns:android="http://schemas.android.com/apk/res/android"> <manifest> <application android:theme="@style/theme.mytheme"/> </manifest> </android>
Comments
Post a Comment