【问题标题】:Change new text view inside of a dialog在对话框中更改新的文本视图
【发布时间】:2012-06-15 17:35:35
【问题描述】:

我在对话框内构建了一个线性布局,这里的问题是我想更改此布局的 TextView 但我不知道如何! ,,有什么帮助吗?

【问题讨论】:

    标签: android dialog android-linearlayout


    【解决方案1】:

    与普通视图一样。

    TextView text = (TextView) dialog.findViewById(R.id.TextView01);
    text.setText("Hello");
    

    【讨论】:

    • 它崩溃了!!我认为由于(setContentView),我正在使用(setContentView)正在使用的另一个布局中的ID!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-09-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-07-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多