诡刺Guinsoo 2016-12-19 04:23 采纳率: 0%
浏览 4932

android 问题,动态修改 textview 修改后UI不更新

LayoutInflater inflater = (LayoutInflater)this.getSystemService(this.LAYOUT_INFLATER_SERVICE);
View nav_header_view = inflater.inflate(R.layout.nav_header_main, null);

    app = (MyApplication) getApplication();

    TextView tvUserName = (TextView)nav_header_view.findViewById(R.id.userName);
    String userName = app.getUserName();
    tvUserName.setText(userName);
    TextView tvUserEmail = (TextView)nav_header_view.findViewById(R.id.userEmail);
    String userEmail = app.getUserId();
    tvUserEmail.setText(userEmail);


            这里修改的是当前Activity对应xml下的一个子xml,就是导航菜单的头部信息
            ![图片说明](https://img-ask.csdn.net/upload/201612/19/1482121367_532086.png)
            ![图片说明](https://img-ask.csdn.net/upload/201612/19/1482121250_2046.png)
  • 写回答

3条回答 默认 最新

  • 诡刺Guinsoo 2016-12-19 04:24
    关注

    图片说明

    评论

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题