如何 去掉dialog的黑色背景和边框 DEMO
1个回答
展开全部
首先:MainActivity protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.main); } public void dialogStyle(View v){ final Dialog d=new Dialog(this, R.style.dialog); View vv = LayoutInflater.from(this).inflate(R.layout.dialog_test, null); TextView delete = (TextView) vv.findViewById(R.id.delete); d.setCanceledOnTouchOutside(true); d.setContentView(vv); d.show(); delete.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub d.dismiss(); } }); } } 然后:style <style name="dialog" parent="@android:style/Theme.Dialog"> <item name="android:windowFrame">@null</item> <item name="android:windowIsFloating">true</item>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询