Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/12.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
Android 将孩子与另一个孩子之间的mostleft和mostright对齐的困难_Android_Xml_Android Linearlayout - Fatal编程技术网

Android 将孩子与另一个孩子之间的mostleft和mostright对齐的困难

Android 将孩子与另一个孩子之间的mostleft和mostright对齐的困难,android,xml,android-linearlayout,Android,Xml,Android Linearlayout,我想在左侧和右侧显示两个图像,在它们之间显示一个文本视图,距离左侧图像很近,但我无法完成 <LinearLayout android:layout_width="match_parent" android:layout_height="70dp" android:orientation="horizontal"> <ImageView android:id="@+id/image_of_serv

我想在左侧和右侧显示两个图像,在它们之间显示一个文本视图,距离左侧图像很近,但我无法完成

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

     <ImageView
            android:id="@+id/image_of_services"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="5dp"
            android:src="@drawable/ic_menu_camera" />

        <TextView
            android:id="@+id/name_of_services"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="30dp"
            android:text="adasdsad"
    android:layout_weight="8"
            android:textSize="20sp" />

        <ImageView
            android:id="@+id/image_arrow"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="right"
            android:layout_weight="2"
            android:src="@drawable/ic_menu_camera" />
    </LinearLayout>


`


我已经编辑了代码,它完全符合我的要求

您的实际需要是什么?
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:weightSum="10"
    xmlns:android="http://schemas.android.com/apk/res/android">

    <ImageView
        android:id="@+id/image_of_services"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="5dp"

        android:layout_weight="2"
        android:src="@drawable/ic_menu_camera" />

    <TextView
        android:id="@+id/name_of_services"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="adasdsad"
        android:layout_weight="6"
        android:textSize="20sp" />

    <ImageView
        android:id="@+id/image_arrow"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="right"
        android:layout_weight="2"
        android:src="@drawable/ic_menu_camera" />
</LinearLayout>`
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="70dp"
    android:orientation="horizontal">


    <ImageView
        android:id="@+id/image_of_services"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_marginLeft="10dp"
        android:src="@drawable/ic_menu_camera" />

    <TextView
        android:id="@+id/name_of_services"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="30dp"
        android:layout_weight="1"
        android:text="adasdsad"
        android:textSize="20sp" />

    <ImageView
        android:id="@+id/image_arrow"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_marginRight="20dp"
        android:src="@drawable/ic_menu_gallery" />

</LinearLayout>