I am writing an Android application and sometimes the last few pixels of the text are truncated. This happens on several different controls in different parts of the application. This happens both on the emulator and on my phone.
The following is part of the layout, I added background colors so you can see that the parent layout is full-length, but the text view does not properly encircle the context 
After the "r" at the bottom, there is obviously a space, but the "a" at the top is slightly truncated. Here is the layout
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center" android:layout_gravity="center" android:background="#fbff18"> <TextView android:id="@+id/SongRowSongName" android:gravity="left" android:layout_gravity="left" android:ellipsize="end" android:maxLines="1" android:singleLine="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#ff1217"/> <TextView android:id="@+id/SongRowArtistName" android:gravity="left" android:layout_gravity="left" android:ellipsize="end" android:maxLines="1" android:singleLine="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:linksClickable="false" android:background="#ff1217" android:clickable="false"/> </LinearLayout>
I know that I can just set the width to full_parent in the textview, but this is just one instance of the problem, and I donβt understand why I need it. Another major place that this happens is in my herd. 
intent = new Intent().setClass(this, ProfileActivity.class); spec = tabHost.newTabSpec("profile").setIndicator("Profiles", res.getDrawable(R.drawable.ic_tab_profile)) .setContent(intent); tabHost.addTab(spec);
and this is what I use as a background image selector
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/profile_grey" android:state_selected="true" /> <item android:drawable="@drawable/profile_white" /> </selector>
I just have nothing to explain why, when there is a lot of space in the parent, it does not finish the content correctly.
source share