문제

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