按钮在应用程序上不可见.怎么了? [英] Buttons not visible on the application. What's wrong?

查看:22
本文介绍了按钮在应用程序上不可见.怎么了?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为我的测试应用程序"创建了一个空活动,它在预览部分如下所示:

I created an empty activity for 'My Testing App' and it looks like the following in the preview section:

但是当我生成一个构建 apk 并在我的手机中使用它时,结果如下所示:

But when I generated a build apk and used the same in my cell phone the result was like the following:

我只能查看左上角的退出按钮,但应该在其上方的其他两个按钮缺失.我也尝试重新排列屏幕上的图标.我让它们到最底部,最右边,但是当重新安装 apk 时我看不到任何变化.

I can only view the exit button on the very top left but the two other buttons, that should be above it are missing. I tried to rearrange the icons on the screen as well. I made them to go to the bottom, to the right most, but I see no change when the apk is reinstalled.

如何让它们在硬件上可见?

这是此活动的代码快照:

Here is the snap of the code for this activity:

推荐答案

要快速向布局添加约束,只需单击推断约束 按钮在布局编辑器工具栏中.在此处了解有关该功能的更多信息:https://developer.android.com/training/constraint-layout/index.html#use-autoconnect-and-infer-constraints

To quickly add constraints to your layout just click on the Infer Constraints button in the Layout Editor toolbar. Learn more about the feature here: https://developer.android.com/training/constraint-layout/index.html#use-autoconnect-and-infer-constraints

这篇关于按钮在应用程序上不可见.怎么了?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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