Nexus 4 显示屏问题

4
我正在编写一款针对安卓设备的应用,但是在 Nexus 4 手机运行时出现问题。它能正常运行在 Galaxy S3/Note 2 和其他一些设备上。

我已经创建了一个具有 Nexus 4 参数的 AVD,但在其中仍无法正常运行。

问题与我的主活动页面的显示有关,就像马赛克图片一样。

在 logcat 中没有任何信息,我不知道如何进行修正。

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
tools:context=".MainActivity" >

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >


    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/Titre_fav"
            android:textAppearance="?android:attr/textAppearanceLarge" />

        <ImageView
            android:id="@+id/imageView1"
            android:contentDescription="@string/image_desc_star_logo"
            android:layout_width="25dp"
            android:layout_height="25dp"
            android:src="@drawable/ic_fav" />

    </LinearLayout>
    <ScrollView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">
      <LinearLayout
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:id="@+id/fav_scroll">
      </LinearLayout>
    </ScrollView>

</LinearLayout>
<RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true" 
        android:layout_marginBottom="50dp" >
        <TextView
            android:id="@+id/console"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="" />
</RelativeLayout>
<RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"  >
        <Button
            android:id="@+id/nav_to_foud"
            style="?android:attr/buttonStyleSmall"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:text="@string/nav_to_found_text" />

        <Button
            android:id="@+id/nav_to_settings"
            style="?android:attr/buttonStyleSmall"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/nav_to_settings_text" />
    </RelativeLayout>
</RelativeLayout>

如何纠正这个问题?

我无法发布我的屏幕截图,因为我没有10个声望。


编辑:我现在可以发布屏幕截图了,谢谢 :)

可能会是这样的:

correct screen

现在它看起来是这样的:

enter image description here

这是一个加一的操作.. 发一张图片... :) .. 欢迎来到StackOverflow。 - Madushan
发一张图片。我给你点赞! - Kunal S. Kushwah
我和我的Nexus 5有完全相同的问题。 - Lasse
1个回答

0

我找到了一个解决方案,不知道对你是否有用。但是请试着在顶层布局中添加背景到你的xml文件中,例如: android:background="#000000"


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接