Android Studio:选择了组件,但属性编辑器显示“未选择组件". [英] Android Studio: Component is selected but Attributes editor says "No component selected"

查看:226
本文介绍了Android Studio:选择了组件,但属性编辑器显示“未选择组件".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

TL; DR:尽管我可以直接在XML中编辑组件属性(合理性检查-我很理智),但属性"检查器窗格声称未选择任何内容.IE.这不起作用."

TL;DR: Although I can edit component attributes directly in XML (sanity check — I'm sane) the Attributes inspector pane claims nothing is selected. I.e. "It doesn't work."

我在主布局中添加了 CardView .它确实显示在组件树"和设计编辑器"中.我在组件树"窗格中选择 CardView ,但是属性"窗格显示未选择组件".

I added a CardView to the main layout. It does show up in the Component Tree and in the Design Editor. I select the CardView in the Component Tree pane, but the Attributes pane says "No component selected".

我正在MacOS 10.15.1上使用Android Studio 3.5.2.这三个 CardViews 都会发生这种情况(请参见屏幕截图).

I'm using Android Studio 3.5.2 on MacOS 10.15.1. This happens with all three CardViews (see screenshot).

单击文本"选项卡将显示所有组件的XML,包括(所谓的)未选中"组件.我对 CardView XML实体 do 进行的直接编辑生效,并且该应用程序正确构建并运行,同时显示了所有三个 CardViews 并进行了滚动在 ScrollView 中.因此,这可能不是摇篮问题(感谢自动更正,也不是摇篮问题).就像构建过程了解视图,而不是编辑过程一样.

Clicking the Text tab shows the XML for all the components, including the (so-called) "non-selected" one. Direct edits I make on the CardView XML entity do have effect, and the app builds and runs correctly, with all three CardViews showing up and scrolling in the ScrollView. So this is probably not a gradle issue (thanks autocorrect, it's not a cradle problem either). It's more like the build process knows about the views, but not the edit process.

我从头开始重新创建了项目,结果相同.

I re-created the project from scratch, with the same result.

推荐答案

我今天在macOS上的Android Studio中使用FloatingActionButton遇到了同样的问题.

I had the same problem today with a FloatingActionButton in Android Studio on macOS.

重启Android Studio是我的解决方案.

Restarting Android Studio was the solution for me.

这篇关于Android Studio:选择了组件,但属性编辑器显示“未选择组件".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆