I'm attempting to create a modal pop up window for android. Everything appears to be working except the width seems to be limited. Using the android 3.0 emulator with a screen size of 1280X800, the maximum size I can get the width to go is 580.
Here is what I am doing:
I created a themes.xml in platform/android/res/values
<style name="myDialog"> <item name="android:windowFrame">@null</item> <item name="android:windowIsFloating">true</item> <item name="android:windowContentOverlay">@null</item> <item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item> <item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowIsTranslucent">true</item> <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item> <item name="android:windowNoTitle">true</item> <item name="android:backgroundDimEnabled">true</item> </style>In tiapp.xml, I specify that the TiTranslucentActivity use the theme, so when I specify an opacity on the window, it will use the specified theme:
<android xmlns:android="http://schemas.android.com/apk/res/android"> <manifest> <application> <activity android:configChanges="keyboardHidden|orientation" android:name="org.appcelerator.titanium.TiTranslucentActivity" android:theme="@style/myDialog"/> </application> </manifest> </android>Note, I also tried this with TiModalActivity and modal:true, but in that case, I get a black background and the width is still limited.
I then create the window with a view:
var myDialog = Titanium.UI.createWindow({ title: 'My dialog', width: '800dp', height: '600dp', backgroundColor:'#336699', borderColor: '#E9FB00', opacity: 1.0 }); var testView = Titanium.UI.createView({ backgroundColor:'#fff', borderWidth:2, borderColor: '#3914AF', width: '800dp', height: '600dp' }); myDialog.add(testView);Then as part of a button click on the main window, I open the window:
myDialog.open( );The window opens correctly, however no matter what I specify for the width of the view or window, it never goes beyond 580 px. Note, I can adjust the height and that seems to work correctly.
Your Answer
Think you can help? Login to answer this question!