2011-03-27 7 views

답변

6

이 답변 themes.xml에서 Theme.Dialog.Alert

사용 올바르지 않습니다

<!-- Default theme for alert dialog windows, which is used by the 
     {@link android.app.AlertDialog} class. This is basically a dialog 
     but sets the background to empty so it can do two-tone backgrounds. --> 
<style name="Theme.Dialog.Alert" parent="@android:style/Theme.Dialog"> 
    <item name="windowBackground">@android:color/transparent</item> 
    <item name="windowTitleStyle">@android:style/DialogWindowTitle</item> 
    <item name="windowIsFloating">true</item> 
    <item name="windowContentOverlay">@null</item> 
</style> 

이 그런 다음 XML 레이아웃 또는 Android 매니페스트에 referenced here :

01과 같이 적용 할 수 있습니다.

또는 setTheme(int)을 사용한 액티비티 그러나이 방법은 권장되지 않습니다. 이 bug report에 표시된 간단한 샘플 코드.

+1

감사합니다. @ Carl. 어떻게 그것을 내 대화 상자에 적용 할 수 있습니까? –

+0

이것은 대화 상자를 정의한 방법에 따라 다릅니다 (XML 또는 프로그래밍 방식). 테마의 프로그래밍 방식 응용 프로그램은 권장하지 않는 것 같습니다. 나는 내 대답을 약간 업데이트했다. 또한 다음 링크를 참조하십시오. http://www.anddev.org/applying_a_theme_to_your_application-t817.html –

+0

감사합니다. 이것은 xml에 정의되어 있으므로 거기에 테마를 추가하겠습니다. –

0

또한이 문제가 발생하여 AlertDialog와 동일한 UI를 갖는 활동을 만들고 싶습니다. 나는 그것이 조금 어렵다는 것을 알았다. 마지막으로 투명 액티비티를 만들고 해결할 AlertDialog를 시작했습니다.

관련 문제