Note that there are some explanatory texts on larger screens.

plurals
  1. POwrap content for numbers
    primarykey
    data
    text
    <p>I want to use <code>wrap_content</code> on <code>TextView</code> where I keep only numbers (and coma), but I have noticed that this takes more space than needed (as if reserved space for letters). Shown here: <a href="http://img802.imageshack.us/img802/3784/wrap.jpg" rel="nofollow noreferrer">image link http://img802.imageshack.us/img802/3784/wrap.jpg</a></p> <p>Current situation - blue lines, desired - gray lines.</p> <p>If it's not possible to do this with numbers and coma, maybe it is possible only with numbers?</p> <p>This is my layout:</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="match_parent" android:layout_height="match_parent" android:orientation="vertical" &gt; &lt;FrameLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_gravity="center" android:layout_weight="1" android:gravity="center" android:paddingLeft="5dp" &gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:paddingLeft="5dp" &gt; &lt;LinearLayout android:id="@+id/tableRow2" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" android:orientation="vertical" &gt; &lt;TextView android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="sampleText" /&gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" &gt; &lt;ImageView android:id="@+id/imageView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:src="@drawable/image" /&gt; &lt;TextView android:id="@+id/myTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:layout_marginLeft="5dp" android:inputType="phone" android:text="0,00" android:textSize="50dp" /&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; &lt;/FrameLayout&gt; &lt;/LinearLayout&gt; </code></pre> <p>For example, MyTextView works as I wrote. The thing is that I want to center vertical my image, but it's not properly centered due to fact MyTextView takes more space than needed.</p>
    singulars
    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.
 

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