Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/391.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/204.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_Xml_Android Fragments_Android Activity - Fatal编程技术网

Java 按钮不会出现

Java 按钮不会出现,java,android,xml,android-fragments,android-activity,Java,Android,Xml,Android Fragments,Android Activity,我有以下xml: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dim

我有以下xml:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.gelasoft.answeringball.MainActivity$PlaceholderFragment" >

    <ImageView
        android:id="@+id/sphereIcon"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:contentDescription="@string/magicBallDescr"
        android:src="@drawable/ic_launcher" />

    <LinearLayout
        android:id="@+id/table"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/sphereIcon"
        android:orientation="horizontal" >

        <TextView 
            android:id="@+id/txtAnswer"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
        />

        <EditText
            android:id="@+id/launch_codes"
            android:layout_width="match_parent"
            android:layout_height="106dp"
            android:hint="@string/textHint"
            android:inputType="text" />

        <Button 
            android:id="@+id/btnAsk"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" 
            android:text="@string/btnAskQ"           
         />
    </LinearLayout>

</RelativeLayout>

一切都很完美,但按钮不会出现


我错过了什么?我知道这对初学者来说也是很基本的,但作为xml领域的新手,我发现很难理解。

您的内部线性布局具有“水平”方向。我猜您的视图不能在一行中显示TextView、EditText和按钮。没有那么多空间。

您的内部
线性布局
具有“水平”方向。我猜您的视图不能在一行中显示TextView、EditText和按钮。没有那么多空间。尤其是在EditText占据了TextView之后的所有剩余空间之后…@Kody哦,我明白了,现在它出现了。你能回答吗,这样我就可以接受了。