2014-09-25 5 views
0

내 응용 프로그램에서 사용자 지정 대화 상자를 사용하고 있습니다. .my 대화 상자가 둥근 사각형 경계선을 가지고 있으며 제거 할 수 없습니다. 테두리를 제거하는 스타일을 설정하는 데 도움이됩니다. 감사합니다사용자 지정 대화 상자에서 경고 대화 상자 테두리 제거

public class myDialog extends Dialog 
    { 
     private String mMessage = ""; 

     public myDialog(Context context, String message) 
     { 
      super(context); 
      requestWindowFeature(Window.FEATURE_NO_TITLE); 
      View v = getLayoutInflater().inflate(R.layout.dialog, null); 
      mMessage = message; 
      setCancelable(false); 
      setCanceledOnTouchOutside(false); 
      setContentView(v); 
      getWindow().setLayout(300,150); 
      getWindow().setBackgroundDrawableResource(R.); 
     } 
    } 

내 대화 cutom 레이아웃 :

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
       android:orientation="vertical" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:background="@drawable/dialog" 
       > 
</LinearLayout> 

답변

0

이것은 오랜 시간 안드로이드의 대화 상자와 관련된 이슈입니다. styles.xml

<style name="ActivityDialog" parent="@android:style/Theme.Dialog"> 
    <item name="android:windowBackground">@null</item> 
    <item name="android:windowFrame">@null</item> 
    <item name="android:windowIsFloating">true</item> 
    <item name="android:backgroundDimEnabled">true</item> 
    <item name="android:windowTitleStyle">@style/ActivityDialog</item> 
</style> 

YourDialog.java

Dialog dialog = new Dialog(getActivity(), R.style.ActivityDialog); 
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); 
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(0)); 

: 나는 그것을 해결할 수 있었던 유일한 방법은 다음을 대신 DialogDialogFragment을 확장하고 추가하는 것입니다

0

안드로이드 : 국경 = "보이지 않는"또는 투명. 온라인에서 정보를 찾을 수 있습니다.

관련 문제