Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/15.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/9/spring-boot/5.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
Xml 按钮根本不显示_Xml_Eclipse_Android Layout_Xml Parsing - Fatal编程技术网

Xml 按钮根本不显示

Xml 按钮根本不显示,xml,eclipse,android-layout,xml-parsing,Xml,Eclipse,Android Layout,Xml Parsing,我是一名初学者,正在从事android的开发工作。我试图在编辑文本之后显示“Go”按钮,但它在活动中不显示。我有以下代码来显示xml文件中的按钮。 我现在该怎么办? 请帮忙 Xml文件 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.andr

我是一名初学者,正在从事android的开发工作。我试图在编辑文本之后显示“Go”按钮,但它在活动中不显示。我有以下代码来显示xml文件中的按钮。 我现在该怎么办? 请帮忙

Xml文件

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:orientation="vertical"
    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">

    <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">

     <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="start|center_vertical"
        android:text="@string/loc"
        android:textSize="20sp"/>
     <EditText 
        android:id="@+id/editText1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center|center_vertical"
        android:ems="10">
        <requestFocus />
</EditText>

     <Button
         android:id="@+id/button1"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_gravity="end|center_vertical"
         android:text="@string/go"
         android:onClick="geoLocate"/>


     </LinearLayout>

    <fragment
        android:id="@+id/map"
        android:layout_width="match_parent"
        android:layout_height="fill_parent"
        class="com.google.android.gms.maps.SupportMapFragment"/>

</LinearLayout>

希望这对您有所帮助
将内部
EditText
更改为

    <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">

     <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="start|center_vertical"
        android:text="@string/loc"
        android:textSize="20sp"/>
     <EditText 
        android:id="@+id/editText1"
        android:layout_width="0dp"
        android:layout_weight="1"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:ems="10">
        <requestFocus />
     </EditText>

     <Button
         android:id="@+id/button1"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_gravity="end|center_vertical"
         android:text="@string/go"
         android:onClick="geoLocate"/>


     </LinearLayout>

希望这对您有所帮助
将内部
EditText
更改为

    <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">

     <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="start|center_vertical"
        android:text="@string/loc"
        android:textSize="20sp"/>
     <EditText 
        android:id="@+id/editText1"
        android:layout_width="0dp"
        android:layout_weight="1"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:ems="10">
        <requestFocus />
     </EditText>

     <Button
         android:id="@+id/button1"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_gravity="end|center_vertical"
         android:text="@string/go"
         android:onClick="geoLocate"/>


     </LinearLayout>


Thanx buddy。这对我有用。我想给这个答案打分。但是,在你说出实际问题是什么以及为什么你建议添加/更改一些东西之前?Thanx buddy。这对我有用。我想给这个答案打分。但是在你说出实际问题是什么以及为什么你建议添加/更改一些东西之前?