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.
我只是通过使用带有按钮和文本字段的线性布局来做一个迷你游戏。我想有一个像 flappy bird 中的高分叠加层一样的叠加层:
(中间的橙色框)
有没有办法在不将我当前的布局转换为画布的情况下获得这个?谢谢 !
您需要更改LinearLayout为 RelativeLayout. 将叠加层默认设置为不可见,然后setVisibility(View.VISIBLE)在您希望它显示时在叠加层上使用。
LinearLayout
RelativeLayout
setVisibility(View.VISIBLE)