Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I agree with sokie on the use of <code>wrap_content</code>. I tend to use <code>LinearLayout</code> a lot since it provides a consistent layout on various display sizes. One way of implementation is as follows. By replacing your inner <code>RelativeLayout</code> to <code>LinearLayout</code>, your text view containing the name will always be displayed and the message text view will display the maximum possibles lines (or can be limited by specifying the <code>maxLines</code>) with the available remaining/space. If you would like to display the whole status message, then you can achieve this by changing the parent <code>LinearLayout</code> height parameter to <code>wrap_content</code>.</p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="56dp" android:minHeight="?android:attr/listPreferredItemHeight"&gt; &lt;ImageView android:id="@+id/icon" android:layout_width="22dp" android:layout_height="50dp" android:layout_marginLeft="4dp" android:layout_marginRight="15dp" &gt; &lt;/ImageView&gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"&gt; &lt;TextView android:id="@+id/uNameTxt" android:layout_width="match_parent" android:layout_height="wrap_content" android:singleLine="true" android:textAppearance="?android:attr/textAppearanceMedium" /&gt; &lt;TextView android:id="@+id/customMsg" android:layout_width="match_parent" android:layout_height="wrap_content" android:maxLines="4" android:textStyle="italic" /&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

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