图像视图未显示在屏幕重叠中

时间:2019-01-18 14:17:43

标签: android kotlin

我正在像Facebook Messenger一样在屏幕上制作一个叠加层,该叠加层可以正常工作,但是它只显示布局中存在的textview,但不显示相同布局中的图像

我试图重建项目,清理它,但似乎无法解决问题

MyFrame.NavigationService.Navigate(new Uri("Home.xaml", UriKind.Relative));

它应该看起来像这样,但它并不只显示图像

enter image description here enter image description here

这是我的布局xml文件

    windowManager = getSystemService(Context.WINDOW_SERVICE) as WindowManager
    val params = WindowManager.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT,
        WindowManager.LayoutParams.MATCH_PARENT,
        WindowManager.LayoutParams.TYPE_PHONE,
        WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
        PixelFormat.OPAQUE)

    //Inflate the chat head layout we created
    val visitorAlertView = LayoutInflater.from(this).inflate(R.layout.overlay_visitor_alert, null)





    windowManager.addView(visitorAlertView, params)

1 个答案:

答案 0 :(得分:0)

使用src代替srcCompat

相关问题