TextView background and wrap_content

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

TextView background and wrap_content

Postby sunabozu » Tue Aug 11, 2009 1:11 pm

Hi.
I have this layout:
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <TableLayout android:id="@+id/TableLayout01" android:layout_width="wrap_content" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android">
  2.  
  3.         <TableRow android:id="@+id/TableRow01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@color/blue">
  4.  
  5.                 <EditText android:id="@+id/search_field" android:text="" android:layout_height="fill_parent" android:layout_width="wrap_content" android:layout_weight="0.4"></EditText>
  6.  
  7.                 <Button android:text="Search" android:id="@+id/btn" android:layout_width="fill_parent" android:layout_height="fill_parent"></Button>
  8.  
  9.         </TableRow>
  10.  
  11.         <TableRow android:id="@+id/TableRow02" android:layout_width="wrap_content" android:layout_height="wrap_content">
  12.  
  13.                 <TextView android:id="@+id/results" android:textColor="@color/white" android:paddingLeft="0px" android:layout_alignParentLeft="true" android:layout_width="wrap_content" android:textStyle="bold" android:background="@drawable/results_bg"></TextView>
  14.  
  15.         </TableRow>
  16.  
  17. </TableLayout>
Parsed in 0.004 seconds, using GeSHi 1.0.8.4

This looks like:
Image
But I need something like this:
Image
My .9.png background is not so wide. Why it's stretched?
sunabozu
Freshman
Freshman
 
Posts: 7
Joined: Tue Aug 11, 2009 12:58 pm

Top

Postby sunabozu » Sat Aug 15, 2009 2:49 pm

Anybody?
sunabozu
Freshman
Freshman
 
Posts: 7
Joined: Tue Aug 11, 2009 12:58 pm

Postby Shanytc » Sat Aug 15, 2009 5:47 pm

try play with the:

android:layout_marginLeft="100dip"
android:layout_marginTop="120dip"

settings
- Shany -
Shanytc
Junior Developer
Junior Developer
 
Posts: 17
Joined: Fri Aug 14, 2009 11:00 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Google [Bot] and 4 guests