[英]Strange problems with ConstraintLayout and Toolbar
I've got some problems. 我有一些问题。 with Costraint Layout and Toolbar.
与Costraint布局和工具栏。 I upload some images to explain better what happens.
我上传了一些图片以更好地说明会发生什么。 I can't do nothing.
我无能为力 If I add a new button It doesn't show it.
如果我添加一个新按钮,它不会显示。 I don't know if it is a normal situation, but if you have a solution, please, help me.
我不知道这是否正常,但是如果您有解决方法,请帮助我。 Thanks in advance
提前致谢
enter image description here 在此处输入图片说明
在xml文件中添加button
,并告诉我们如果它不起作用将导致什么错误
Change your ConstraintLayout
to RelativeLayout
and then add below code and see what happens: 将您的
ConstraintLayout
更改为RelativeLayout
,然后添加以下代码,看看会发生什么:
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
在gradle文件中将android api目标更改为25
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.