Piszę aplikację dla systemu Android, a niektóre ostatnie piksele tekstu są obcięte. Dzieje się to na kilku różnych kontrolach w różnych częściach aplikacji. Dzieje się tak zarówno na Emulatorze, jak i na moim telefonie.Tekst brakuje kilka ostatnich pikseli
Poniżej jest częścią układu, dodałem kolory tła, dzięki czemu można zobaczyć, że układ rodzic bierze się na całej długości, ale widok tekst nie jest zawijany kontekst poprawnie
Po ' r 'na dole to oczywiście luka, ale "a" na górze jest lekko ścięte. Oto układ
<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>
wiem, może po prostu ustawić szerokość do full_parent na TextView, ale to jest tylko jedna instancja problemu i ja nie rozumiem, dlaczego muszę. Drugim głównym miejscem, w którym się znajduje, jest mój tabhost.
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);
i to co używam jako selektor obrazu tła
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- When selected, use grey -->
<item android:drawable="@drawable/profile_grey" android:state_selected="true" />
<!-- When not selected, use white-->
<item android:drawable="@drawable/profile_white" />
</selector>
To po prostu nie ma sensu dla mnie, dlaczego kiedy tam jest dużo miejsca na rodzica to nie Zawijanie treści poprawnie.
Czy robisz coś śmiesznego z domyślną czcionką? Wydaje się, że jest źle mierzony. – HalR
Po to, co jest warte, właśnie skopiowałem kod tekstowy i nie mam tego problemu na urządzeniu 4.2 lub emulatorze. Na jakim poziomie interfejsu API testujesz? –
@HalR, Nie zrobiłem nic z czcionkami, które mogę wymyślić, czy sugerujesz w aplikacji lub ustawieniach na moim telefonie? – Jason