2012年5月28日 星期一

Textfield/Button distorted on Android device

If UI components like textfield or button display properly in emulator but not in Android device, check the following:

- Titanium SDK 2.01.GA2
- Android Runtime: V8 (Javascript engine which convert javascript to machine code)
- Add Android manifest in tiapp.xml

    <android xmlns:android="http://schemas.android.com/apk/res/android">
        <manifest>
            <supports-screens android:anyDensity="false"/>
            <application>
                <activity android:alwaysRetainTaskState="true"
                    android:configChanges="keyboardHidden|orientation"
                    android:label="KitchenSink"
                    android:name=".KitchensinkActivity" android:theme="@style/Theme.Titanium">
                    <intent-filter>
                        <action android:name="android.intent.action.MAIN"/>
                        <category android:name="android.intent.category.LAUNCHER"/>
                    intent-filter>
                activity>
            application>
        manifest>
        <activity android:name="ti.modules.titanium.ui.android.TiPreferencesActivity"/>
        <services>
            <service type="interval" url="testservice.js"/>
        <services>
<android>

沒有留言:

張貼留言