I have debugged and everything goes fine; moreover, in Graphical Layout everything is fine. here you can see the code:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="5dp"
android:paddingBottom="10dp"
android:background="#color/white" >
<ImageView
android:id="#+id/image"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_marginStart="5dp"
android:src="#drawable/news_img1" />
<TextView
android:id="#+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_alignParentTop="true"
android:layout_toEndOf="#id/image"
android:text="Pizza Rondon"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="#+id/description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/title"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:layout_toEndOf="#id/image"
android:text="Ingredients: meat, potato, tomato, salad included too. " />
<TextView
android:id="#+id/price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginEnd="20dp"
android:text="60 Lei"
android:textColor="#color/dimmed_red"
android:textStyle="bold" />
</RelativeLayout>
and here is the result as this view is an item from ExpandableListView:
I dont set any data to TextViews inside my customAdapter. What could cause the TextViews to dissapear? I can't even see any difference between price and others two which are not shown, which do not differ much in layout.
Did you try changing text color - maybe it is set to white??? The price is showing because android:textColor="#color/dimmed_red"
Related
I'm trying to put an N (new) badge at the end of the Textview. But Android Studio gives me that two Textviews, hashtag_list_row_title and hashtag_list_row_new can overlap if one Textview contains some lengthy string.
In production environment, it's not likely that hashtag_list_row_title is long, but I want to prevent two Textviews from being overlapped. How can I achieve this?
I prefer the way hashtag_list_row_new has priority over hashtag_list_row_title because that's more natural way to display an N badge.
So far my code is as follows.
list_row.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/hashtag_list_row_root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/bg_list_row_selector" >
<RelativeLayout
android:id="#+id/hashtag_list_row_title_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:layout_marginTop="24dp"
android:layout_toLeftOf="#+id/hashtag_list_row_post_count"
android:layout_toStartOf="#+id/hashtag_list_row_post_count">
<TextView
android:id="#+id/hashtag_list_row_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:ellipsize="end"
android:gravity="center_vertical"
android:textColor="#color/hotspot_list_row_title"
android:textSize="16sp"
android:textStyle="bold"
android:text="asdfasdfsadfsadfsfsfsafasdfsafsfasfasfasf" />
<TextView
android:id="#+id/hashtag_list_row_new"
android:layout_toRightOf="#+id/hashtag_list_row_title"
android:layout_toEndOf="#+id/hashtag_list_row_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/red"
android:textStyle="bold"
android:layout_marginTop="2dp"
android:layout_marginLeft="11dp"
android:layout_marginStart="11dp"
android:text="#string/N" />
</RelativeLayout>
<TextView
android:id="#+id/hashtag_list_row_post_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginEnd="20dp"
android:layout_marginRight="20dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:background="#drawable/btn_post_normal"
android:gravity="center"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:textColor="#787878"
android:textSize="12sp"
android:textStyle="bold" />
<View
android:id="#+id/hashtag_list_row_divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="#+id/hashtag_list_row_title_layout"
android:layout_marginTop="24dp"
android:background="#color/bg_horizontal_divider" />
</RelativeLayout>
Edit
Textview on the right side should place right next to the left one, which has varying length. And I want to prevent the situation where the left one gets longer beyond certain length so that the right one is hidden, or overlapped, or whatever.
It should look as below.
| (text) N (empty space empty)|
| (more text) N (empty space) |
| (more text more more...) N |
Edit 2
I want the left TextView to be ellipsized when it's beyond the width of the row except for N badge. I want this.
I don't want this.
Edit 3
N badge should not be placed on the right side all the time. I want the badge to be placed right next to the left TextView when the length is shorter than horizontal width.
It's good.
It's no go.
Ran into the same problem.
What you want is the right side TextView to have:
android:layout_toEndOf="#+id/member_count"
The ID being the ID of the left side TextView.
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:orientation="horizontal">
<TextView
android:id="#+id/member_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/white"
android:textStyle="bold"
android:text="10"
android:textSize="16sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/white"
android:layout_toEndOf="#+id/member_count"
android:text="Members"
android:textSize="16sp"/>
</RelativeLayout>
Try something like below.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/hashtag_list_row_root"
android:background="#drawable/bg_list_row_selector"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<RelativeLayout
android:id="#+id/hashtag_list_row_title_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:layout_marginTop="24dp"
android:layout_toLeftOf="#+id/hashtag_list_row_post_count"
android:layout_toStartOf="#+id/hashtag_list_row_post_count">
<TextView
android:singleLine="true"
android:id="#+id/hashtag_list_row_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:ellipsize="end"
android:gravity="center_vertical"
android:textColor="#color/hotspot_list_row_title"
android:textSize="16sp"
android:textStyle="bold"
android:text="asdfasdfsadfsadfsfsfsafasdfsafsfasfasfasf" />
</RelativeLayout>
<TextView
android:id="#+id/hashtag_list_row_post_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginEnd="20dp"
android:layout_marginRight="20dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:background="#drawable/btn_post_normal"
android:gravity="center"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:textColor="#787878"
android:textSize="12sp"
android:textStyle="bold" />
<TextView
android:layout_centerVertical="true"
android:id="#+id/hashtag_list_row_new"
android:layout_toLeftOf="#+id/hashtag_list_row_post_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/red"
android:textStyle="bold"
android:layout_marginTop="2dp"
android:layout_marginLeft="11dp"
android:layout_marginStart="11dp"
android:text="#string/N" />
<View
android:id="#+id/hashtag_list_row_divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="#+id/hashtag_list_row_title_layout"
android:layout_marginTop="24dp"
android:background="#color/bg_horizontal_divider" />
</RelativeLayout>
Result will be something similar like below. I had to remove some attributes that was pointing to resources that my project didn't have, so below figure is just a mock up. The code is updated to fit you.
Hello all i need to develop layout like whats app in chatting screen like
in this i want to display time after chat textview complete.
For that i have done
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/blue" >
<TextView
android:id="#+id/tv_message_chat_item_f"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginTop="2dp"
android:gravity="left|center"
android:paddingBottom="#dimen/one_dp"
android:paddingLeft="#dimen/fifteen_dp"
android:paddingRight="#dimen/five_dp"
android:paddingTop="#dimen/one_dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="fgfdgdf rete tretretret rtrtrwtw fgdfr grtwerwerewr ewrwerew" />
<TextView
android:id="#+id/tv_message_time_f"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="#+id/tv_message_chat_item_f"
android:layout_marginBottom="2dp"
android:paddingRight="#dimen/five_dp"
android:gravity="right"
android:paddingBottom="#dimen/one_dp"
android:text="fgfdg"
android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>
But not working with big message (the time texview not set properly)
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:gravity="bottom"
android:background="#drawable/blue"
android:layout_alignParentStart="true" android:weightSum="10">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Hi"
android:layout_weight="1"
android:id="#+id/textView"
android:gravity="bottom"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="bottom"
android:layout_marginStart="10dp"
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
assuming your textView3 is the one with the "Big message" you should first take advantage of relative layout capabilities and use android:layout_below="#id/textview2" this will prevent overlapping with textView2 instead of just aligning everything from the bottom up.
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/textView2"
android:layout_centerHorizontal="true"
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall" />
then after you set your TextView that will hold your 'time' you can once agian use something like
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/textView2"
android:gravity="right"
android:layout_alignParentRight="true"
android:text="12:00 pm"
android:textAppearance="?android:attr/textAppearanceSmall" />
Gravity right will allow the text to be place from right to left, since displaying time usually does not take more than 6 or 7 characters it will help.
Hope it resolves your problem.
You will need to implement ImageViews using 9patches (here: link)
And a listview, which can handle CustomLayouts for ListItems (with the 9Patch ImageView).
I think you are able to implement a list view, therefore I don't go deeper here.
Greets.
I'e been experiencing some odd behavior from the text cursor in the EditTexts of my android application. Essentially, the cursor does not always accurately represent it's position in a word (it's all over the place). As such, typing a character into an edit text can result in the character being placed somewhere different (usually before or after the cursor indicated position). Also, when the cursor is placed inside of or next to a word, that word is often offset slightly.
Here is an example of the phenomenon;
Notice the words moving position from picture to picture, and in the second example the cursor indicates that it is before the i but is in fact before the e two indexes to the right.
Here is the EditText element of this View in the XML;
<EditText
android:id="#+id/hazard_obs_text"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_below="#+id/hazard_observation"
android:layout_alignLeft="#+id/hazard_observation"
android:layout_alignRight="#+id/hazard_observation"
android:layout_above="#+id/finalise_hazard"
android:layout_marginTop="5dp"
android:background="#drawable/whitebackselector"
android:hint="Recommendation Text"
android:textSize="9sp"
android:gravity="start"
android:paddingLeft="5dp"
android:enabled="false"
/>
As you can see, it is inside a RelativeLayout, and has a custom blank white background with some subtle shading around the edge. It is also part of a Fragment layout. Nothing out of the ordinary as far as I can see. No exceptions or errors are being thrown. I am stumped. Does anyone have any ideas what could be causing this odd behavior?
Extra details by request;
The Layout isn't changed programmatically in any way except to be inflated initially (it is in a Fragment after all). Below is any line of code that interacts programmatically with the above example EditText -
obsText = (EditText) fragmentView.findViewById(R.id.hazard_obs_text);
...
obsText.setEnabled(tf); // Where tf is a boolean value.
...
obsText.getText().clear();
...
obsText.setText(observations[0].split(" ", 3)[1]); // Where observations[0] is a string.
...
obsText.setText(currentAssessment.obsDescript); // Setting another string.
Below is the full fragment layout. It is worth noting that I am also having the same issue in a very simple LinearLayout -
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:background="#070054"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<AutoCompleteTextView
android:id="#+id/hazard_code"
android:layout_width="0dp"
android:layout_height="20dp"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="#+id/hazard_code_browse_button"
android:layout_marginTop="10dp"
android:layout_marginLeft="10dp"
android:gravity="center_vertical"
android:hint="Hazard Code"
android:background="#drawable/whitebackselector"
android:singleLine="true"
android:textSize="12sp"
android:selectAllOnFocus="true"
android:paddingLeft="5dp"
android:dropDownWidth="fill_parent"
android:dropDownHeight="125dp"
android:dropDownVerticalOffset="1dp"
android:completionThreshold="1"
/>
<Button
android:id="#+id/hazard_code_browse_button"
android:layout_width="30dp"
android:layout_height="20dp"
android:layout_toLeftOf="#+id/sfrp_drops"
android:layout_marginTop="10dp"
android:layout_marginBottom="5dp"
android:layout_marginRight="7dp"
android:background="#drawable/crossselector"
/>
<Spinner
android:id="#+id/hazard_observation"
android:layout_width="0dp"
android:layout_height="20dp"
android:layout_marginTop="10dp"
android:layout_toRightOf="#+id/sfrp_drops"
android:layout_toLeftOf="#+id/pictures"
android:background="#drawable/whitebackselector"
android:paddingLeft="5dp"
android:dropDownWidth="wrap_content"
android:dropDownHeight="125dp"
android:dropDownVerticalOffset="1dp"
android:enabled="false"
/>
<LinearLayout
android:id="#+id/sfrp_drops"
android:orientation="horizontal"
android:layout_centerHorizontal="true"
android:layout_width="160dp"
android:layout_height="20dp"
android:layout_marginTop="10dp"
android:layout_marginRight="5dp"
>
<Spinner
android:id="#+id/hazard_severity"
android:layout_width="0dp"
android:layout_height="20dp"
android:layout_weight="1"
android:background="#drawable/whitebackselector"
android:prompt="#string/hazard_severity"
android:paddingLeft="5dp"
android:enabled="false"
/>
<Spinner
android:id="#+id/hazard_frequency"
android:layout_width="0dp"
android:layout_height="20dp"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:background="#drawable/whitebackselector"
android:prompt="#string/hazard_frequency"
android:paddingLeft="5dp"
android:enabled="false"
/>
<Spinner
android:id="#+id/hazard_risk"
android:layout_width="0dp"
android:layout_height="20dp"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:background="#drawable/whitebackselector"
android:prompt="#string/hazard_risk"
android:paddingLeft="5dp"
android:enabled="false"
/>
<Spinner
android:id="#+id/hazard_priority"
android:layout_width="0dp"
android:layout_height="20dp"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:background="#drawable/whitebackselector"
android:prompt="#string/hazard_priority"
android:paddingLeft="5dp"
android:enabled="false"
/>
</LinearLayout>
<LinearLayout
android:id="#+id/pictures"
android:orientation="vertical"
android:layout_width="25dp"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_margin="5dp"
android:background="#drawable/photoreel"
>
<ImageView
android:id="#+id/photo_icon"
android:src="#drawable/hal"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
/>
<Button
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
/>
<Button
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
/>
<Button
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
/>
<Button
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
/>
</LinearLayout>
<EditText
android:id="#+id/hazard_obs_text"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_below="#+id/hazard_observation"
android:layout_alignLeft="#+id/hazard_observation"
android:layout_alignRight="#+id/hazard_observation"
android:layout_above="#+id/finalise_hazard"
android:layout_marginTop="5dp"
android:background="#drawable/whitebackselector"
android:hint="Recommendation Text"
android:textSize="9sp"
android:gravity="start"
android:paddingLeft="5dp"
android:enabled="false"
/>
<EditText
android:id="#+id/hazard_act_text"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_below="#+id/sfrp_drops"
android:layout_alignLeft="#+id/sfrp_drops"
android:layout_alignRight="#+id/sfrp_drops"
android:layout_above="#+id/finalise_hazard"
android:layout_marginTop="5dp"
android:background="#drawable/whitebackselector"
android:hint="Observation Text"
android:textSize="9sp"
android:gravity="start"
android:paddingLeft="5dp"
android:enabled="false"
/>
<Button
android:id="#+id/finalise_hazard"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_alignRight="#+id/hazard_obs_text"
android:layout_alignLeft="#+id/hazard_act_text"
android:layout_alignParentBottom="true"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:background="#drawable/plainbuttonselector"
android:padding="0dp"
android:textColor="#FFFFFF"
android:text="Finalise Entry"
android:enabled="false"
/>
<EditText
android:id="#+id/peoples_at_risk"
android:layout_width="0dp"
android:layout_height="20dp"
android:layout_below="#+id/hazard_location"
android:layout_alignLeft="#+id/hazard_code"
android:layout_toLeftOf="#+id/hazard_act_text"
android:layout_marginTop="5dp"
android:layout_marginRight="7dp"
android:background="#drawable/whitebackselector"
android:textSize="9sp"
android:singleLine="true"
android:paddingLeft="5dp"
android:hint="Peoples at Risk"
android:enabled="false"
/>
<EditText
android:id="#+id/hazard_location"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_below="#+id/hazard_code"
android:layout_alignLeft="#+id/hazard_code"
android:layout_toLeftOf="#+id/hazard_act_text"
android:layout_marginTop="5dp"
android:layout_marginRight="7dp"
android:background="#drawable/whitebackselector"
android:textSize="9sp"
android:paddingLeft="5dp"
android:gravity="start"
android:hint="Hazard Location"
android:enabled="false"
/>
<EditText
android:id="#+id/relevant_legistlation"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_below="#+id/peoples_at_risk"
android:layout_alignLeft="#+id/hazard_code"
android:layout_toLeftOf="#+id/hazard_act_text"
android:layout_alignParentBottom="true"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:layout_marginRight="7dp"
android:background="#drawable/whitebackselector"
android:textSize="9sp"
android:paddingLeft="5dp"
android:gravity="start"
android:hint="Relevant Legislation"
android:enabled="false"
/>
</RelativeLayout>
I am experiencing the issue on a Nexus 10, Galaxy Note 10.1, & Xperia Z2 tablets with the latest version of Android installed. I've also tested this on an old Xperia phone as well which is not having the issue, which begs the question of whether it could be related to screen size. Other applications on the same devices aren't having this issue.
Any help would be greatly appreciated. This has been hounding me for some time now. I am willing to manually award a bounty to anyone who can help towards a solution/explanation.
I spent a great deal of time trying various bits'n'bobs to solve this issue, but the final change that fixed it entirely was adding a (previously absent) uses-sdk element and it's attributes to the Android Manifest.
<uses-sdk android:minSdkVersion="1" android:targetSdkVersion="4" />
These were the lowest values that could be declared without incurring the problem.
Somebody can please explain this?
Why the third TextView is weird?
The definitions for the 2 lines before are the same, and I haven't touched the style with java...
Edit: I've added the XML Layout file.
The XML:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/rl"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="top" >
<TextView
android:id="#+id/quadEqu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="25dp"
android:text="#string/quadequ"
android:textSize="27sp" />
<Button
android:id="#+id/closeBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="30dp"
android:text="#string/close"
android:onClick="close" />
<TextView
android:id="#+id/stepOne"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/quadEqu"
android:layout_centerHorizontal="true"
android:layout_marginTop="25dp"
android:text="#string/quadEquForm"
android:textSize="18sp" />
<TextView
android:id="#+id/stepTwo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/stepOne"
android:layout_below="#+id/stepOne"
android:text="#string/quadEquForm"
android:textSize="18sp" />
<TextView
android:id="#+id/stepThree"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/stepOne"
android:layout_below="#+id/stepTwo"
android:text="#string/quadEquForm"
android:textSize="18sp" />
</RelativeLayout>
It's a strange behaviour.
Try to set the content of the 'stepTwo' to the 'stepThree'.
If the same issue appeared, so the problem from the TextView.
You should check if you modify the padding of 'stepThree' textView programmatically.
In android Text View, when you try to render the subscript, the text gets clipped at the top and bottom. To avoid this, you can try to set the text from HTML.
Example.
stepThree.setText(Html.fromHtml("Some text<sup><small>1</small></sup>"));
stepThree.setText(Html.fromHtml(
"HCO<sub><small><small>3</small></small></sub>));
Refer this link for more details.
Android TextView's subscript being clipped off
Subscript and Superscript a String in Android
You need to change android:layout_height for the TextView (for all 3 is better).
<TextView
android:id="#+id/stepOne"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_below="#+id/quadEqu"
android:layout_centerHorizontal="true"
android:layout_marginTop="25dp"
android:text="#string/quadEquForm"
android:textSize="18sp" />
<TextView
android:id="#+id/stepTwo"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_alignLeft="#+id/stepOne"
android:layout_below="#+id/stepOne"
android:text="#string/quadEquForm"
android:textSize="18sp" />
<TextView
android:id="#+id/stepThree"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_alignLeft="#+id/stepOne"
android:layout_below="#+id/stepTwo"
android:text="#string/quadEquForm"
android:textSize="18sp" />
I have this layout inside of a RelativeLayout:
<LinearLayout
android:id="#+id/llWatchItemCommentButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="#+id/myMasterCat_Item"
style="#style/DropShadowEffect"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_weight="99"
android:shadowColor="#ffffff"
android:text="Item"
android:textColor="#515b61"
android:textSize="22sp" />
<ImageView
android:id="#+id/bFollowComment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/featured_button_selector"
android:padding="5dp"
android:src="#drawable/comment" />
</LinearLayout>
<TextView
android:id="#+id/myMastCat_Cat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/llWatchItemCommentButton"
android:layout_alignLeft="#+id/llWatchItemCommentButton"
android:layout_marginLeft="10dp"
android:text="MasterCat"
android:textColor="#666"
android:textSize="16sp" />
Essentially, if that TextView in the Layout becomes two lines, it will overlap with the TextView positioned below theLinearLayout`.
Is there an attribute perhaps that could correct this? As in, I want the bottom TextView to be below the entire LinearLayout at all times, even if it begins to grow. Right now, the position appears fixed.
Have you tried the following:
<TextView
android:id="#+id/myMastCat_Cat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/llWatchItemCommentButton" //add this line in
android:layout_alignBottom="#+id/llWatchItemCommentButton"
android:layout_alignLeft="#+id/llWatchItemCommentButton"
android:layout_marginLeft="10dp"
android:text="MasterCat"
android:textColor="#666"
android:textSize="16sp" />