先給大家展示效果圖:

實現代碼也很簡單,代碼如下所示:
private void showLabelAlert() { new AlertDialog.Builder(上下文) .setTitle("選擇標簽") .setItems(addressLabels, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if (which != 0) { 文字控件.setText(addressLabels[which]); } } }) .create().show();}String[] addressLabels = new String[]{"無", "家", "公司", "學校",};以上所述是小編給大家介紹的Android 簡單的彈出框(在屏幕中間,傳string[],根據內容框框大小自適應),希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對武林網網站的支持!
新聞熱點
疑難解答