模拟器中的应用程序未随项目更新并显示不同的布局

时间:2017-08-18 20:42:42

标签: android android-layout android-studio android-emulator

首先,我是android studio IDE的新手。当我试图在模拟器中显示我的项目结果时,模拟器向我显示的结果与我在项目中创建的结果不同。例如,布局完全不同。我还没有使用任何代码或添加新的java代码。我才开始学习布局,这个问题出现了。在我打开模拟器之后,我在项目中进行的任何更改都被模拟器跟随。所以,你能帮我解决这个问题吗?我将添加一些截图:

Here is the screenshot of my project for showing you How the project and emuator shows different screens

And here, when I add a progress bar on my project, emulator is not updating itself with this and still show the same screen.

2 个答案:

答案 0 :(得分:1)

您已使用Constraint布局,因此您必须为视图提供一个水平和一个垂直约束,否则它将转到(0,0)位置。

答案 1 :(得分:0)

这是因为您没有在xml文件中设置绝对位置。如果你去看xml,它会在“TextView”和任何其他对象下面有红线。

通过将TextView形状上的点拖到屏幕布局的边缘来修复它。

希望它有所帮助。