2011-11-14 4 views
1

나는 나의 경고 대화 상자이 있고,이에 AlertDialog 및 DialogPreference

ContextThemeWrapper ctw = new ContextThemeWrapper(MvcnContactList.this, R.style.MyTheme); 
       alertDialogBuilder = new AlertDialog.Builder(ctw); 
//set some views and onclick listeners 
       alertDialog = alertDialogBuilder.create(); 
       alertDialog.setCancelable(false); 
       alertDialog.show(); 

완벽하게 작동하지만 기본 설정 대화 상자에 대해, 그리고 나는이 대화 상자 내 경고 대화 상자와 같은 같은 회전식를 갖고 싶어. 나는 안드로이드 넣어 :하지만 내 대화

public class About extends DialogPreference { 
    public AboutDialog(Context oContext, AttributeSet attrs) 
    { 
     super(oContext, attrs); 
    } 
} 

주에이 스타일을 적용 뜨거운 모르는 내 pref.xml 파일에 스타일 = "@ 스타일/impex_dialog"를,이 스타일 태그가 인식되지 않습니다.

답변

0

경고 대화 상자가 사용 :

안드로이드 소스에서
com.android.internal.R.style.Theme_Dialog_Alert 

:

그래서
protected AlertDialog(Context context, boolean cancelable, OnCancelListener cancelListener) { 
    super(context, com.android.internal.R.style.Theme_Dialog_Alert); 
    setCancelable(cancelable); 
    setOnCancelListener(cancelListener); 
    mAlert = new AlertController(context, this, getWindow()); 
} 

themes.xml에 정의 된 나는, 당신이 뭔가를 시도해야 같아요

<!-- 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>