RelativeLayout wrap_content width, circular dependency - android

Want to design a custom marker-baloon for the new Google Maps v2 API for Android. I have overridden getInfoContents but my now the layout takes the full width of the screen with ym custom design. I want it to wrap around the text with a max width.
I have found my problem after reading online, its probably that I have circular dependency in the RelativeLayout which is not permitted. But then how would I move the textfield "place" to the right of the layout, in line with the title but on the right side?
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:paddingBottom="2sp"
android:paddingLeft="5sp"
android:paddingTop="1sp"
android:textColor="#color/list_item_title_color"
android:textSize="15sp"
android:textStyle="bold" />
<TextView
android:id="#+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"sa
android:layout_below="#id/title"
android:ellipsize="end"
android:maxLines="3"
android:paddingBottom="3sp"
android:paddingLeft="5sp"
android:paddingRight="5sp"
android:textColor="#color/list_item_text_color"
android:textSize="13sp" />
<TextView
android:id="#+id/place"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:gravity="right"
android:paddingRight="5sp"
android:paddingTop="1sp"
android:textColor="#color/list_item_date_color"
android:textSize="13sp" />
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/icons"
android:layout_width="fill_parent"
android:layout_height="32dp"
android:layout_below="#id/place"
android:gravity="right"
android:orientation="vertical"
android:paddingBottom="2sp"
android:paddingLeft="5sp"
android:paddingRight="5sp" >
</LinearLayout>
</RelativeLayout>

Can't you just add:
android:layout_toRightOf="#id/title"
to your place textview?
EDIT:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<RelativeLayout
android:id="#+id/leftLayout"
android:layout_alignParentLeft="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:paddingBottom="2sp"
android:paddingLeft="5sp"
android:paddingTop="1sp"
android:textColor="#color/list_item_title_color"
android:textSize="15sp"
android:textStyle="bold" />
<TextView
android:id="#+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"sa
android:layout_below="#id/title"
android:ellipsize="end"
android:maxLines="3"
android:paddingBottom="3sp"
android:paddingLeft="5sp"
android:paddingRight="5sp"
android:textColor="#color/list_item_text_color"
android:textSize="13sp" />
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/icons"
android:layout_width="fill_parent"
android:layout_height="32dp"
android:layout_below="#id/place"
android:gravity="right"
android:orientation="vertical"
android:paddingBottom="2sp"
android:paddingLeft="5sp"
android:paddingRight="5sp" >
</LinearLayout>
</RelativeLayout>
<TextView
android:id="#+id/place"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_toRightOf="#id/leftLayout"
android:gravity="right"
android:paddingRight="5sp"
android:paddingTop="1sp"
android:textColor="#color/list_item_date_color"
android:textSize="13sp" />
</RelativeLayout>
Here, try this, but it's not tested.

Unless I misunderstand, you should be able to wrap the "title, place, and text" in a linearlayout
<LinearLayout
android:id="#+id/textLL
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
//textViews
</LinearLayout>
now use
android:layout_toRightOf="#+id/textLL"
in your "icons" layout. Or is this not what you want?

Related

Words get cut of in Android ListView

I'm stuck with a small problem in my listview. I tried several things like adding padding or changing the margins. But this didn't fix my problem.
Words keep getting cut of in the last rule.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:divider="?android:dividerVertical"
android:showDividers="middle"
android:dividerPadding="8dp">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="#+id/violationstitlebar"
>
<TextView
android:layout_width="#dimen/violation_list_col1"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="#string/resTaskviolPos"/>
<TextView
android:layout_width="#dimen/violation_list_col2"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="#string/resTaskviolDescriptionNLB"/>
<TextView
android:layout_width="#dimen/violation_list_col3"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
/>
<TextView
android:layout_width="#dimen/violation_list_col4"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="#string/resTaskDescriptionFRB" />
<TextView
android:layout_width="#dimen/violation_list_col5"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
/>
<TextView
android:layout_width="#dimen/violation_list_col6"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="#string/resTaskviolBLS"/>
<TextView
android:layout_width="#dimen/violation_list_col7"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="#string/resTaskviolRepeat"
/>
<TextView
android:layout_width="#dimen/violation_list_col8"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:divider="?android:dividerVertical"
android:showDividers="middle"
android:dividerPadding="8dp"
>
<TextView
android:layout_width="#dimen/violation_list_col1"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text=""
android:id="#+id/tvViolListPosition"
android:paddingLeft="10dp"
android:paddingBottom="10dp"/>
<TextView
android:layout_width="#dimen/violation_list_col2"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text=""
android:id="#+id/tvViolListDescription"
android:layout_weight="1"
android:maxLines="4"
/>
<ImageButton
android:layout_width="#dimen/violation_list_col3"
android:layout_height="50dp"
android:id="#+id/ibViolListEditDesc"
/>
<TextView
android:layout_width="#dimen/violation_list_col4"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text=""
android:id="#+id/tvViolListDescriptionFRB"
android:layout_weight="1"
/>
<ImageButton
android:layout_width="#dimen/violation_list_col5"
android:layout_height="50dp"
android:id="#+id/ibViolListEditDescFRB"
/>
<Spinner
android:layout_width="#dimen/violation_list_col6"
android:layout_height="wrap_content"
android:id="#+id/spViolListConclusion"
style="?android:dropDownSpinnerStyle"/>
<EditText
android:layout_width="#dimen/violation_list_col7"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:id="#+id/etViolListCounter"
android:inputType="number"
/>
<ImageButton
android:layout_width="#dimen/violation_list_col8"
android:layout_height="50dp"
android:id="#+id/ibViolListDelete"
/>
</LinearLayout>
</LinearLayout>
Does anyone have an idea how to fix this?
kind regards,
Tim
give some limitaion to charaters ,while adding the content of your NLB
maxlines, minimum lines
<EditText
android:id="#+id/AddressEdittext"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/textView4"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginTop="15dp"
android:background="#drawable/retangle_shape"
android:gravity="top|left"
android:hint="Type Here..."
android:inputType="textMultiLine"
android:lines="5"
android:maxLines="10"
android:minLines="5"
android:paddingBottom="5dp"
android:paddingLeft="#dimen/padding"
android:paddingRight="#dimen/padding"
android:paddingTop="5dp"
android:scrollbars="vertical" >
</EditText>
Try using this property also with some padding bottom:
android:includeFontPadding="false"
And:
android:baselineAligned="false"
I think you can solve it with layout_weight attribute.
More info on layout_weight can be found on:
http://ugia.io/2012/01/19/android-linearlayout-distribution-explained-weight-and-sizes/
http://developer.android.com/guide/topics/ui/layout/linear.html

Fixed horizontal ScrollView above ListFragment

I am displaying a list using a custom ListFragment. The fragment inflates a layout and works fine. I want to add a horizontal scrollView above the fragment to act as a category menu. It must be fixed, so addHeaderView is not acceptable.
I found a layout example here on SO and plugged it into my layout to see how it could be made to work. But in its current form below, it does what you would expect - puts a horizontal scrollview in every entry on the list.
So how do I share a screen with a static view on top and the listfragment below.
Here is the layout that does not work - as I mentioned the Scrollview part is not mine and is only included as an example. The relativelayout at the bottom makes the actual list
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="false" >
<HorizontalScrollView
android:id="#+id/hor_svID"
android:layout_width="wrap_content"
android:layout_height="35dip"
android:scrollbars="none"
android:fillViewport="false"
android:focusable="false" >
<!--android:background="#drawable/submenu_bg"> -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:focusable="false"
android:background="#FFFFFF"
android:gravity="center">
<TextView android:id="#+id/TechnologyTxtVId"
android:text="TECHNOLOGY"
android:textColor="#342D7E"
android:textSize="12sp"
android:textStyle="bold"
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></TextView>
<TextView android:id="#+id/SportsTxtVId"
android:text="SPORTS"
android:textColor="#342D7E"
android:textStyle="bold"
android:textSize="12sp"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:paddingLeft="15dip"></TextView>
<TextView android:id="#+id/EntntTxtVId"
android:text="ENTERTAINMENT"
android:textStyle="bold"
android:paddingLeft="15dip"
android:textSize="12sp"
android:gravity="center"
android:textColor="#342D7E"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></TextView>
<TextView android:id="#+id/LocalTxtVId"
android:text="LOCAL"
android:textStyle="bold"
android:paddingLeft="15dip"
android:textSize="12sp"
android:textColor="#342D7E"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></TextView>
<TextView android:id="#+id/WorldTxtVId"
android:text="WORLD"
android:textStyle="bold"
android:textSize="12sp"
android:paddingLeft="15dip"
android:gravity="center"
android:textColor="#342D7E"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></TextView>
<TextView android:id="#+id/FeaturesTxtVId"
android:text="FEATURES"
android:textStyle="bold"
android:textSize="12sp"
android:paddingLeft="15dip"
android:gravity="center"
android:textColor="#342D7E"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></TextView>
<TextView android:id="#+id/RecentTxtVId"
android:text="RECENT"
android:textStyle="bold"
android:textSize="12sp"
android:paddingLeft="15dip"
android:gravity="center"
android:textColor="#342D7E"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></TextView>
</LinearLayout>
</HorizontalScrollView>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="false" >
<ImageView
android:id="#+id/imageView_thumbnail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginRight="#dimen/default_padding"
android:contentDescription="#null"
android:focusable="false"
android:src="#drawable/ic_launcher" />
<TextView
android:id="#+id/textView_source"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/imageView_thumbnail"
android:layout_alignParentTop="true"
android:layout_marginRight="#dimen/default_padding"
android:focusable="false"
android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
android:id="#+id/textView_pubDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="#dimen/default_padding"
android:focusable="false"
android:textAppearance="?android:attr/textAppearanceSmall"
/>
<TextView
android:id="#+id/textViewHeadline"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/imageView_thumbnail"
android:layout_alignParentRight="true"
android:layout_below="#+id/textView_pubDate"
android:layout_marginLeft="#dimen/default_padding"
android:focusable="false"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold" />
<TextView
android:id="#+id/textViewSummary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/textViewHeadline"
android:layout_toRightOf="#+id/imageView_thumbnail"
android:maxLines="#integer/Four"
android:layout_marginLeft="#dimen/default_padding"
android:focusable="false"
android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
</RelativeLayout>

Align textviews in linearlayout

This is what I want to achieve:
main.xml
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp" >
<TextView
android:id="#+id/tvNameContainer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="3dp"
android:layout_marginLeft="2dip"
android:layout_weight="0.29"
android:textColor="#FFF"
android:gravity="center_horizontal"
android:text="#string/fullname"
android:textStyle="bold" />
<TextView
android:id="#+id/tvDiagnosisContainer"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="3dp"
android:layout_weight="0.57"
android:gravity="center_horizontal"
android:text="#string/diagnosis"
android:textColor="#color/white"
android:textStyle="bold" />
</LinearLayout>
custom_row.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="#+id/fullname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:layout_weight="0.29"
android:text="text"
android:textColor="#color/black" />
<TextView
android:id="#+id/lname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.29"
android:text="text"
android:textColor="#color/black" />
<TextView
android:id="#+id/diagnosis"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.57"
android:text="#string/diagnosis"
android:padding="5dp"
android:textColor="#color/black" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="#+id/lastffupcontainer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/lastffup"
android:padding="5dp"
android:textColor="#color/black" />
<TextView
android:id="#+id/lastffup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/lastffup"
android:padding="5dp"
android:textColor="#color/black" />
</LinearLayout>
</LinearLayout>
This is the result:
But I can't seem to make those spaces between the textviews. Any ideas?
Correct me if I'm wrong but it looks like the only issue you are having is having the "Diagnosis" TextView in the ListView spaced more to the right. For this I would change that LinearLayout to a RelativeLayout. Then you can give it the property android:layout_alignParentRight="true" and add in some android:marginRight="some dp" if needed.
You can use Android's new fancy GridLayout (http://developer.android.com/reference/android/widget/GridLayout.html or http://developer.android.com/reference/android/support/v7/widget/GridLayout.html) to get exactly what you're looking for.
Try and replace your LinearLayout tags with GridLayout instead and it just might work for you. (make sure you add the support library to your project if you need to support devices < api 14).

Place TextView at right of other one and make it always visible

It is easy to place one TextView at right of another TextView but when width on base TextView more than screen size right TextView became not visible.
My XML layout:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="#+id/messages"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:lines="1"
android:text="Messages" />
<TextView
android:id="#+id/counter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:background="#drawable/bg_white_r30p0pl10"
android:drawableRight="#drawable/arrow_orange"
android:text="800" />
</LinearLayout>
How to make right TextView screen even if base TextView width is huge?
UPD:
In other words I need:
If first TextView is short:
|[ShotrTextView][TextView] |
If first TextView is long:
|[LooooooongTextVi...][TextView]|
The solution is TableLayout usage with shrinkColumns = 0
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:shrinkColumns="0" >
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/messages"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:lines="1"
android:text="Messages" />
<TextView
android:id="#+id/counter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:background="#drawable/bg_white_r30p0pl10"
android:drawableRight="#drawable/arrow_orange"
android:text="800" />
</TableRow>
</TableLayout>
Try this
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:inputType="text"
android:text="" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_weight="0"
android:inputType="text"
android:text="12345" />
</LinearLayout>
Posting this as thinking line the only way to do the so...
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:singleLine="true"
android:layout_height="wrap_content"
android:text="Medium TextMedium TextMedium TextMedium Text"
android:maxWidth="280dp"
android:ellipsize="end"
/>
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:text="HHH"
/>
And create one dimension file like this and use it.
Check the answer in: Two TextViews side by side, only one to ellipsize?
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView android:id="#+id/messages" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1"
android:ellipsize="end" android:lines="1" android:text="Message" />
<TextView android:id="#+id/counter" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="5dp"
android:layout_weight="1" android:background="#drawable/bg_white_r30p0pl10" android:drawableRight="#drawable/arrow_orange" android:text="800" />
</LinearLayout>

Android: Tablelayout with relative layouts contained within?

I have an xml layout that compiles fine but when I used the intent to change to the new view it force closes. I'm almost positive it has to do with my use of table and relative layouts. It's kind of a frankenstien monster of coding, haha. Please let me know if how I can remedy this force close problem. Also, before I had strickly table layout. With this layout it compiled and was fully functional, just not as a pretty. So the java should be fine (theoretically).
CODE:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout android:id="#+id/tableLayout1"
android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android" android:background="#FFFFF0">
<RelativeLayout android:orientation="vertical" android:background="#drawable/banner"
android:layout_width="fill_parent" android:layout_height="50sp" android:gravity="center" >
</RelativeLayout>
<RelativeLayout android:id="#+id/tableTitle" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:background="#999">
<TextView android:id="#+id/ListingsTitle" android:text="Title: "
android:textColor="#000" android:textStyle="bold" android:textSize="20sp" />
<TextView android:id="#+id/sellingprice" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:textColor="#000fff"
android:text="Price:" android:layout_below="#id/ListingsTitle" ></TextView>
<TextView android:id="#+id/mileage" android:layout_below="#id/ListingsTitle" android:layout_toRightOf="#id/sellingprice" android:layout_height="wrap_content" android:text="Mileage:" android:textColor="#000fff" android:layout_width="wrap_content"></TextView>
</RelativeLayout>
<RelativeLayout android:orientation="vertical" android:background="#FFFFF0"
android:layout_width="fill_parent" android:layout_height="wrap_content">
<ImageButton android:id="#+id/PhotoGallerybtn"
android:src="#drawable/icon" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_alignParentLeft="true"></ImageButton>
<Button android:text="Email the Dealer" android:id="#+id/EmailDealerbtn" android:layout_alignParentLeft="true"
android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="#id/PhotoGallerybtn"></Button>
<Button android:text="Add to Favs" android:id="#+id/Favsbtn" android:layout_below="#id/PhotoGallerybtn"
android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="#id/EmailDealerbtn"></Button>
<Button android:text="Share" android:id="#+id/Sharebtn" android:mimeType="image/*"
android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="#id/PhotoGallerybtn" android:layout_toRightOf="#id/Favsbtn"></Button>
</RelativeLayout>
<TableRow android:id="#+id/tableRow4" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:background="#999">
<TextView android:id="#+id/textName" android:text="Details:"
android:textColor="#000" android:textStyle="bold" android:textSize="20sp" />
</TableRow>
<TextView android:id="#+id/bodystyle" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:textColor="#000"
android:text="Body Style:"></TextView>
<TextView android:id="#+id/color" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:textColor="#000"
android:text="Color:"></TextView>
<TextView android:id="#+id/doors" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:textColor="#000"
android:text="Doors:"></TextView>
<TextView android:id="#+id/engine" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:textColor="#000"
android:text="Engine:"></TextView>
<TextView android:id="#+id/vin" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:textColor="#000"
android:text="VIN:"></TextView>
</TableLayout>
You should add layout_width and layout_height fields to your TextView with #+id/ListingsTitle id:
<TextView android:id="#+id/ListingsTitle" android:text="Title: "
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#000"
android:textStyle="bold"
android:textSize="20sp" />

Categories

Resources