Вопрос

I have an activity with the dialog theme applied as below

<activity
            android:name="com.denso.phone3.IncomingCallActivity"
            android:label="@string/app_name"
            android:launchMode="singleInstance"
            android:theme="@style/Theme.Transparent" >
</activity>

the theme is as below

<style name="Theme.Transparent" parent="Theme.NoTitle">
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:windowBackground">@android:color/transparent</item>
        <item name="android:windowContentOverlay">@null</item>
        <item name="android:windowIsFloating">true</item>
        <item name="android:backgroundDimEnabled">true</item>
        <item name="android:backgroundDimAmount">0.5</item>
        <item name="android:windowFullscreen">true</item>
</style>

In spite of all this my dialog looks like thisflaw. As you can see there is some space left on the right and bottom.FYI, This is the behaviour of all the dialogs on my machine.

Some one on SO suggested this as fix , which didn't work.

setContentView(R.layout.activity_incoming_call);
getWindow().setLayout(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
Это было полезно?

Решение

Using android Theme fixed the issue

<activity
            android:name="com.denso.phone3.IncomingCallActivity"
            android:label="@string/app_name"
            android:launchMode="singleInstance"
            android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" >
</activity>
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top