问题:如图,四个圆角改为直角。
java代码:
- Java code
package com.bxdm.xwplayer.online.util;import com.example.httptext.R;import android.app.Activity; import android.app.AlertDialog; import android.app.ProgressDialog; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; public class test extends Activity { /** Called when the activity is first created. */ ProgressDialog p_dialog; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.dialog); LayoutInflater factory = LayoutInflater .from(test.this); final View DialogView = factory.inflate( R.layout.dialog, null); AlertDialog dlg = new AlertDialog.Builder( test.this)// .setTitle("") // .setMessage("") // .setView(DialogView) .create(); dlg.setView(DialogView, 0, 0, 0, 0); dlg.show(); } }
布局文件:
- Java code
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:background="#FFFFFF" > <RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="" /> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_alignParentTop="true" android:layout_marginRight="15dp" android:src="@drawable/close" /> </RelativeLayout> <TextView android:layout_margin="100dip" android:layout_width="wrap_content" android:layout_height="wrap_content" /></LinearLayout>
------解决方案--------------------
首先看看Theme.Dialog这个是怎么定义的,然后去看看自己定义theme,然后在创建dialog的时候, 把自己定义的theme传递过去,至于行不行,你自己看看吧