将dialog背景设置为空,透明的

解决方案 »

  1.   

    Light.NoActionBar改成Translucent.NoActionBar
      

  2.   

    贴错了<item name="android:windowIsTranslucent">true</item><!-- 半透明 -->
      

  3.   

    我刚刚试了一下Translucent.NoActionBar,囧,木有找到对应的选项,半透明我之前试过,是把整个窗口半透明了,我是想去掉后面那层白色的底哈。
      

  4.   

    关于设置背景透明的方法,为了避免干扰,新建了一个test工程
    结果如下:
    <color name="transparent">#b000</color>
    设置背景方法一:
    <style name="CustomAlertDialogBackground" parent="@android:style/Theme.Holo.Light.Dialog">
      <item name="android:background">@color/transparent</item>
      <item name="android:windowBackground">@null</item>
    </style>
    设置背景方法二:
    <style name="CustomAlertDialogBackground" parent="@android:style/Theme.Holo.Light.Dialog">
      <item name="android:background">@null</item>
      <item name="android:windowBackground">@color/transparent</item>
    </style>
    用AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), R.style.CustomAlertDialogBackground);加载这个style方法一的结果:方法二的结果:不知道我的方法是否有错误。
    我那个圆角处的白色底边依然还在,实际背景的区域好似也不是白色那一层,白边的问题依然不懂如何去掉,求解啊!!!
      

  5.   

    getDialog().getWindow().setBackgroundDrawable(newColorDrawable(Color.TRANSPARENT));完事!
      

  6.   

    把 xxxxx.setView() //只修改内容
    更改成
    xxxxx.setContentView()//修改整个dialog窗口的显示
    就没有后面的背景了。