以前我不知道怎么设置透明。偶尔一次在查别的问题的时候,发现了怎么透明。
一、在style文件里面添加
<style name="Translucent_NoTitle" parent="android:style/Theme.Dialog">
<item name="android:background">#00000000</item> <!-- 设置自定义布局的背景透明 -->
<item name="android:windowBackground">@android:color/transparent</item> <!-- 设置window背景透明,也就是去边框 -->
</style>
二、在new 对话框的时候
AlertDialog.Builder builder=new AlertDialog.Builder(mcontext,R.style.Translucent_NoTitle);
然后就行了。