2

次のコードを使用して警告ダイアログを作成し、その中にリスト項目を挿入しました

今、私はこのアイテムを非表示にするか、ダイアログ内で削除したいのですが、それはそれを行う方法です

AlertDialog.Builder builder = new AlertDialog.Builder(this);
LayoutInflater factory = LayoutInflater.from(this);
final View directionEntryView = factory.inflate(R.layout.contact_dialog, null);                  

title.setText(contactStore.getContactName());
builder.setTitle(contactStore.getContactName());

/** Once I fill the item list , i want to make it invisible **/
builder.setItems(R.array.select_dialog_items, null);

アイテムリストは以下の通り

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string-array name="select_dialog_items" >
        <item>Command one</item>
        <item>Command two</item>
        <item>Command three</item>
        <item>Command four</item>
    </string-array>
</resources>
4

1 に答える 1

0

これを使用してください: title.setVisibility(View.GONE);

于 2012-02-24T14:40:46.510 に答える