Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Try something like this</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation = "vertical" android:padding="6dip" &gt; &lt;TextView android:id = "@+id/myTextBar" android:layout_width = "fill_parent" android:layout_height = "wrap_content"` android:text = "This is my text bar over my image and other info"/&gt; &lt;LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation = "horizontal" android:padding="6dip" &gt; &lt;ImageView android:id="@+id/icon" android:layout_width="100sp" android:layout_height="100sp" android:layout_marginRight="6dip" android:src="@drawable/car1" /&gt; &lt;LinearLayout android:orientation="vertical" android:layout_width="0dip" android:layout_weight="1" android:layout_height="fill_parent"&gt; &lt;TextView android:id="@+id/make" android:layout_width="fill_parent" android:layout_height="0dip" android:layout_weight="1" android:gravity="center_vertical" android:textColor="#000"/&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; </code></pre> <p><img src="https://i.stack.imgur.com/kKFOx.png" alt="enter image description here"></p> <p>If you want to do it with relative layout, this is how it would look like:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height = "wrap_content" android:padding="6dip"&gt; &lt;TextView android:id = "@+id/title_bar_text" android:layout_width = "fill_parent" android:layout_height = "wrap_content" android:layout_alignParentTop = "true" android:text = "This is the title bar" android:gravity = "center_horizontal"/&gt; &lt;ImageView android:id="@+id/icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical = "true" android:layout_alignParentLeft="true" android:layout_below = "@id/title_bar_text" android:layout_marginRight="6dip" android:src="@drawable/icon" /&gt; &lt;TextView android:id="@+id/make" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_toRightOf="@id/icon" android:layout_below = "@id/title_bar_text" android:layout_alignParentRight="true" android:layout_alignBottom = "@id/icon" android:gravity="center_vertical" android:singleLine="true" android:ellipsize="marquee" android:textColor="#FFFFFFFF" android:textStyle="bold" android:layout_alignWithParentIfMissing="true" android:text = "This is the text beside the image"/&gt; &lt;/RelativeLayout&gt; </code></pre> <p>It looks like this:</p> <p><img src="https://i.stack.imgur.com/eL19d.png" alt="enter image description here"></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload