使用API​​ 17时,呈现的Andr​​oid按钮文字不集中按钮、文字、API、oid

2023-09-06 02:30:16 作者:装得了淑女卖得了萌

在布局的图形视图,当我选择API 15或更低,从下面的图片中显示的按钮,在包围按钮上的文本看起来很好。

In the graphical view of layout, when I choose API 15 or lower from the button shown in the image below, the text in the encircled buttons looks fine.

当我选择API 17,文本被移动即使XML code是一样的。更改按钮填充于事无补。

When I choose API 17, the text is displaced even though the xml code is same. Changing the button padding does not help.

这只是Eclipse问题或者是没有可能的Andr​​oid的新版本可能会看到这种流离失所的文字?

Is this just a problem with Eclipse or is it possible that new versions of android may see this displaced text?

有什么解决办法来解决这个问题?

What's the workaround to fix this?

XML code:

<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>

推荐答案

安卓重力=中心无助

我重新启动eclipse的两倍。奇怪的是它并没有在第一次重新启动帮助,但它之后第二个看起来很正常。此外,它的做工精细的设备。 道歉的问题,我必须张贴问题之前,等待着。

I restarted eclipse twice. Strangely it did not help in the first restart but it looked fine after the second one. Also, its working fine on device. Apologies for the question, I must have waited before posting the question.