Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid EditText vertical sizing: I want it to be small!
    text
    copied!<p>Here are sample pictures of two <code>EditText</code> fields I've added in an Action Bar: <img src="https://i.stack.imgur.com/zjPBm.png" alt="This is from the Graphical View"></p> <p>[This is from the Graphical Layout tool in Eclipse] <img src="https://i.stack.imgur.com/PENX2.png" alt="enter image description here"></p> <p>[This is what it looks like in my emulator (2.1 WVGA854)</p> <p>My question is, how can I make the <code>EditText</code> look a bit closer to the Graphical Layout? Or is this a function of the emulation? On my device, which has a custom rom, the <code>EditText</code> is square but looks similar to the Graphical Layout, which is what I want.</p> <p>I've tried setting the textAppearance to <code>"@android:attr/textAppearanceSmall"</code>. This does help in that it changes the size of the text within the EditText to be viewable, but it does not affect the size of the <code>EditText</code> itself.</p> <p>Here's the XML for my EditText:</p> <pre><code>&lt;EditText android:maxLines="1" android:scrollHorizontally="true" android:textAppearance="@android:attr/textAppearanceSmall" android:layout_marginTop="5dip" android:layout_marginLeft="5dip" android:layout_marginRight="5dip" android:layout_width="fill_parent" android:layout_height="wrap_content" /&gt; </code></pre> <p>I could post the full XML, but essentially this EditText is enclosed (along with the search icon ImageView) in a RelativeLayout that is within another RelativeLayout.</p> <p>Thanks for any help!</p> <p><strong>EDIT</strong> By request, here is the full XML for the top search bar:</p> <pre><code>&lt;RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content"&gt; &lt;ImageButton android:id="@+id/IBSearchOverlayMic" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:background="@drawable/aslctr_search_overlay_blackbutton" android:src="@drawable/search_overlay_ic_microphone" /&gt; &lt;ImageView android:id="@+id/IVSearchOverlayDivider1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toLeftOf="@id/IBSearchOverlayMic" android:src="@drawable/search_overlay_division" /&gt; &lt;ImageButton android:id="@+id/IBSearchOverlaySearch" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toLeftOf="@id/IVSearchOverlayDivider1" android:background="@drawable/aslctr_search_overlay_blackbutton" android:src="@drawable/search_overlay_ic_searchwhite" /&gt; &lt;RelativeLayout android:id="@+id/RLSearchOverlaySearch" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@id/IBSearchOverlaySearch" android:layout_alignBottom="@id/IBSearchOverlaySearch" android:layout_alignParentLeft="true" android:layout_toLeftOf="@id/IBSearchOverlaySearch" android:layout_centerVertical="true" android:background="@drawable/search_overlay_searchbg"&gt; &lt;EditText android:id="@+id/ETSearchOverlaySearch" android:maxLines="1" android:scrollHorizontally="true" android:textAppearance="@android:attr/textAppearanceSmall" android:layout_marginTop="5dip" android:layout_marginLeft="5dip" android:layout_marginRight="5dip" android:layout_width="fill_parent" android:layout_height="wrap_content" /&gt; &lt;ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignRight="@id/ETSearchOverlaySearch" android:layout_centerVertical="true" android:layout_marginRight="10dip" android:clickable="false" android:focusable="false" android:src="@drawable/search_actionbar_ic_searchcream" /&gt; &lt;/RelativeLayout&gt; &lt;/RelativeLayout&gt; </code></pre>
 

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