如何摆脱android对话框中烦人的标题?
这就像我阅读对话框:
data myDialog = new data(context);
myDialog.show();
这是我的对话
public class data extends Dialog {
public data(Context context) {
super(context);
}
TextView txtName;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.data);
setTitle("annoying title");
Button btnClose;
Button btnexit;
txtName = (TextView)findViewById(R.id.txtName);
txtName.setText(MyParam.Fname_Lname);
//txtName.setText(MyParam.zPhone);
btnClose = (Button) findViewById(R.id.btnDiel);
btnClose.setOnClickListener(new Close());
btnexit = (Button) findViewById(R.id.btnSMS);
btnexit.setOnClickListener(new exit());
}
private class Close implements android.view.View.OnClickListener {
public void onClick(View v) {
data.this.dismiss();
}
}
private class exit implements android.view.View.OnClickListener {
public void onClick(View v) {
data.this.dismiss();
}
}
我尝试删除此行setTitle("annoying title");
我试试这个
myDialog.getWindow();
myDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
但如果我这样做,我会看到我的对话框是垂直线