我需要将自定义对话框设置为透明.
示例代码:
Dialog dialog;
@Override
protected Dialog onCreateDialog(int id)
{
switch(id)
{
case 1:
AlertDialog.Builder builder = null;
Context mContext = this;
LayoutInflater inflater = ( LayoutInflater ) mContext.getSystemService( LAYOUT_INFLATER_SERVICE );
View layout = inflater.inflate( R.layout.about_page, ( ViewGroup ) findViewById( R.id.about_Root ) );
builder = new AlertDialog.Builder( mContext );
builder.setView( layout );
dialog = builder.create();
break;
}
return dialog;
}
Run Code Online (Sandbox Code Playgroud)
如何设置透明对话框.
我的XML代码:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/about_Root"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/alert_page_border"
android:orientation="vertical" >
<TextView
android:id="@+id/about_Title"
android:layout_width="wrap_content"
android:layout_height="0dip"
android:gravity="center"
android:layout_weight="1"
android:textSize="25dip" …Run Code Online (Sandbox Code Playgroud) 我是android的初学者.我正在创建一个自定义对话框,它工作正常.但是此对话框不会移动.如何移动此自定义对话框.例如,在Windows中包含记事本,画图等.当您单击此(记事本,画图等)标题栏时,您可以移动位置.如果可能,请发送信息如何移动对话框.否则,如果无法发送原因.请回复你的答案,评论对我很有价值.谢谢.
我的Android设备包含默认文件管理器和一个按钮(打开).单击按钮时如何打开文件管理器?
我的问题是当对话框显示的时候我可以点击对话框外面,那时我的对话框会自动被删除.我能做什么.请用代码发送答案.谢谢.