我試圖顯示一個AlertDialog有一個列表。當我在Android IC上運行應用程序時,我沒有任何問題,但是當我在Android 2.3上嘗試時,AlertDialog出現一個可怕的邊框,它位於View的上層和下層。 我已經嘗試了主題和許多事情,但我有問題補充說AlertDialog.Builder(上下文,主題)在API 11下無效。 你知道任何解決方案嗎?謝謝!Android上的AlertDialog缺少邊框<3.0
public boolean updialog (String table) {
String [] data = bd.List(1, table);
if(data[0]=="") {
AlertDialog.Builder dialog = new AlertDialog.Builder(this,android.R.style.Theme_Translucent_NoTitleBar);
View view = View.inflate(getApplicationContext(), R.layout.drop_no_resquest, null);
dialog.setView(view); dialog.create();
dialog.show();
return true;
}
AlertDialog.Builder dialog = new AlertDialog.Builder(a);
View view = View.inflate(getApplicationContext(), R.layout.drop, null);
ListView lv = (ListView) view.findViewById(R.id.drop_listview);
ArrayAdapter<String> adap = new ArrayAdapter<String> (getApplicationContext(),
R.layout.list_item_custom,R.id.list_item_custom_text,data);
lv.setAdapter(adap);
dialog.setView(view);
dialog.create();
dialog.show(); return true;
}
但是AlertDialog.Builder(上下文,主題)是在API 11上引入的,我如何在API <11上添加主題?謝謝! – jramirez
哦,我的壞!那麼我猜想除此之外沒有別的選擇。 –
看到我的編輯。你可以使用'Dialog'類實現這一點。 –