Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/193.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 安装后,按钮不会显示在应用程序中_Java_Android_Button_Barcode Scanner - Fatal编程技术网

Java 安装后,按钮不会显示在应用程序中

Java 安装后,按钮不会显示在应用程序中,java,android,button,barcode-scanner,Java,Android,Button,Barcode Scanner,我试着建立一个二维码扫描仪,当我安装在apk上时,Button并没有出现在应该出现的地方 这是我的按钮代码: <Button android:id="@+id/scan_btn" android:layout_width="127dp" android:layout_height="0dp" android:layout_centerHorizontal="true" android:layout_centerVertical="true"

我试着建立一个二维码扫描仪,当我安装在apk上时,Button并没有出现在应该出现的地方

这是我的按钮代码:

 <Button
    android:id="@+id/scan_btn"
    android:layout_width="127dp"
    android:layout_height="0dp"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true"
    android:layout_marginBottom="359dp"
    android:layout_marginStart="117dp"
    android:text="@string/scan"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toBottomOf="@+id/textView2"
    android:layout_marginLeft="117dp" />

有人能帮我吗?

您没有设置按钮的高度,0dp表示它不可见


-将其更改为包裹内容或更高dp的内容。

您将身高保持在0dp。它是垂直约束的吗?

谢谢,先生,它可以工作!为我的愚蠢道歉,哈哈哈。你能帮我问另外一个问题吗?拜托,我需要尽快完成我的项目。下一个问题是什么?对不起,那是我的错误。其答案已由投票决定: