我想设置的透明窗口,默认alertDialogbox。 。 。 我该怎么能够做到这一点? 我Alertbox是像这个。请参考它。 。
I want to set the Transparent window for the Default alertDialogbox. . . How can i able to do it ?? My Alertbox is as like this. Please refer it. .
在此先感谢。 。
链接是活动 How在Android的创建透明的活动?
但你仍然可以将相同主题对话框了。
but still you can apply the same theme for dialog box too.
修改
在对话框创建一个类,如下
Create a class for the dialog as below
CustDialog.java
public class CustomDialog extends Dialog implements android.view.View.OnClickListener {
Button button_home,button_cancel,button_resume;
public GamePauseMenu(Context context) {
super(context,R.style.Theme_Transparent);
}
public void show(int bg) {
// TODO Auto-generated method stub
super.show();
setContentView(R.layout.custdialog);
button_resume = (Button)findViewById(R.id.imageButton1);
button_resume.setOnClickListener(this);
}
public void onClick(View v) {
cancel();
}
}
custdialog.xml 的布局:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/linearLayout1"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:gravity="center|center_vertical|center_horizontal"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<Button android:id="@+id/imageButton1" android:background="@drawable/menu_home"
android:layout_height="wrap_content" android:layout_width="fill_parent"
android:drawingCacheQuality="auto" android:duplicateParentState="true"></Button>
<Button android:background="@drawable/menu_next" android:id="@+id/imageButton2"
android:layout_height="wrap_content" android:layout_width="fill_parent"></Button>
<Button android:id="@+id/imageButton3" android:background="@drawable/menu_reset"
android:layout_height="wrap_content" android:layout_width="fill_parent"></Button>
</LinearLayout>
上一篇:是&QUOT;这&QUOT空;一个可接受的使用扩展方法?可接受、方法、QUOT、UOT
下一篇:Date对象的SimpleDateFormat不能正确解析时间戳字符串中的Java(安卓)环境字符串、对象、正确、环境