I'm using a TextView
inside a a "LabeledTextView" component (Basically, a TextView whose label moves from one side to the other when dealing with Layout changes caused to due Right to Left languages). I'm using this inside a ListView and this is occuring:
The last line of text is being truncated horizontally. Is this perhaps a bug in Android's TextView onMeasure()
?
This same "LabeledTextView" component is used in other situations and is working completely fine, so I'm thinking this has something to do with the interaction between it and the ListView
.
The corresponding part of the list item xml looks like so:
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="400dp"
android:orientation="vertical" >
<com.test.library.view.LabeledTextView
android:id="@+id/sender"
android:layout_width="match_parent"
android:layout_height="wrap_content"
custom:label="@string/sender"
custom:labelWidth="130dp"/>
<com.test.library.view.LabeledTextView
android:id="@+id/message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
custom:label="@string/message"
custom:labelWidth="130dp"/>
</LinearLayout>
You can see that in the containing LinearLayout I've ensured the height of the container isn't curtailing the size.
The custom view sets the LayoutParams
as WRAP_CONTENT
for height - you can see it's grown to be almost the correct size.
EDIT
When increasing the size of the LabeledTextView manually however, the TextView
is displaying correctly so I think the default onMeasure()
of my Custom View isn't correctly accounting for the TextView
childs height.