title: XML markup in the Android application
body: <p>How do I distribute the objects so that the TextView is perfectly in the middle of the parent object, and the ImageButton is on the left. Tried to install for the parent element</p>
  <pre><code>android:gravity=&quot;center&quot;
  </code></pre>
  <p>, as well as for the TextView itself</p>
  <pre><code>android:layout_gravity=&quot;center&quot;
  </code></pre>
  <p>, but nothing comes out. I attach the code below.</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;RelativeLayout
      xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
      xmlns:tools=&quot;http://schemas.android.com/tools&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      tools:context=&quot;.add&quot;&gt;
  
      &lt;LinearLayout
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;67dp&quot;
          android:orientation=&quot;horizontal&quot;
          android:gravity=&quot;center&quot;&gt;
  
          &lt;ImageButton
              android:id=&quot;@+id/backArrow&quot;
              android:layout_width=&quot;30dp&quot;
              android:layout_height=&quot;match_parent&quot;
              android:scaleType=&quot;fitCenter&quot;
              android:background=&quot;@color/transparent&quot;
              android:src=&quot;@drawable/back_arrow&quot; /&gt;
  
          &lt;TextView
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:fontFamily=&quot;@font/tenor_sans&quot;
              android:text=&quot;@string/adder&quot;
              android:textColor=&quot;#2C1E4D&quot;
              android:textSize=&quot;24sp&quot; /&gt;
  
      &lt;/LinearLayout&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>