Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有两个Webviews,但在某些时候我想把后面的一个放在前面。我希望两者都可见。
Webviews
是否可以更改布局顺序?
Android 视图堆栈中没有 Z 轴位置的概念,因此您不能将视图放在前面或发送到后面。您需要将视图的可见性标志设置为隐藏、可见或不可见(分别为 .setVisibility(GONE、VISIBLE 或 INVISIBLE))。如果您希望它们有时都可见,那么您至少需要使顶视图(最后添加到父视图的那个)具有透明背景,这样如果它们的 Visibilities 设置为 VISIBLE,则后面的视图将通过顶部显示看法。
凯文