W widoku graficznym układu, gdy wybiorę API 15 lub mniej z przycisku pokazanego na poniższym obrazku, tekst w otaczających przyciskach wygląda dobrze.Tekst przycisku Androida nie jest wyśrodkowany podczas korzystania z interfejsu API 17 do renderowania
Kiedy wybrać API 17, tekst jest przesunięty mimo że kod XML jest taki sam. Zmiana dopełnienia przycisku nie pomaga.
Czy to tylko problem z Eclipse czy to możliwe, że nowe wersje Androida mogą zobaczyć ten wyparty tekst?
Co to jest obejście tego problemu?
kod XML:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".HomeActivity" >
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_margin="3dp" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="100dp"
android:src="@drawable/label" />
</LinearLayout>
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/linearLayout1"
android:layout_below="@+id/linearLayout1"
android:layout_marginTop="20dp"
android:text="@string/about_title"
android:textSize="20sp" />
<TextView
android:id="@+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView1"
android:layout_alignRight="@+id/linearLayout1"
android:layout_below="@+id/textView1"
android:layout_marginTop="5dp"
android:text="@string/temp" />
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView2"
android:layout_alignRight="@+id/textView2"
android:layout_below="@+id/textView2"
android:layout_marginTop="20dp"
android:baselineAligned="false" >
<Button
android:id="@+id/button1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/news" />
<Button
android:id="@+id/button2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/tournaments" />
<Button
android:id="@+id/button3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/results" />
</LinearLayout>
dobrze słyszeć :) Nie zapomnij przyjąć jednej z odpowiedzi :) – Goddchen
Nie mogę przyjąć własnej odpowiedzi w ciągu 2 dni od wysłania ... –
Wpadłem na ten sam problem. Dzięki! –