在Nexus 5重叠的背景(和重叠的图像) [英] Overlap background (and overlap image) on Nexus 5

查看:169
本文介绍了在Nexus 5重叠的背景(和重叠的图像)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是的重叠的背景(或重叠图像)的问题,我只得到它的Nexus 5模拟器而测试。我没有在Nexus 5的设备测试,但我认为应该模拟器显示相当正确的。

This is the Overlap Background (or Overlap Image) problem which I only get it on Nexus 5 Emulator while testing. I have not tested on Nexus 5 Device, but I think the Emulator should show quite correct.

这是我的编码表示如何支持多屏幕,它为其他设备,而不是Nexus 5的模拟器其次在这里回答,但也没有它的工作原理

This is my coding indicated how to support multiple screen, it works for the others device, not for Nexus 5 emulator. Followed the answer in here also but it not works.

在我的应用程序,我用片段页面之间传递。它发生了,当我从第一页(红色词语的图像)(图像中的蓝色字)转移到第二页。第二页的背景为黑色,但它仍然让第一页的背景,它是如此陌生。

In my application, I used Fragment to transfer among pages. It happened when I transfer from first page (red words in image) to second page (blue words in image). Background of second page is Black, but it still so Background of first page, it's so strange.

在/ res文件夹,我用:


    /绘,华电国际
  • 中等质量的图像

高品质的图像/绘-xhdpi

更​​优质的图像/绘-xxhdpi

Higher quality image in /drawable-xxhdpi.

另外随着不同的布局文件夹试过,但它不适合我的工作:将复制/布局文件夹/布局xhdpi或/布局xxhdpi

Also tried with different layout folder, but it not works for me : copy all files from /layout folder to /layout-xhdpi or /layout-xxhdpi.

在我manifest.xml文件:(虽然定义screenDensity = 445,因为Nexus 5的屏幕具有密度为445 PPI,它仍然没有工作)

In my manifest.xml file : (Although defined screenDensity=445 since Nexus 5 has screen density is 445 ppi, it still not works)

<compatible-screens>

    <!-- all small size screens -->
    <screen
        android:screenDensity="ldpi"
        android:screenSize="small" />
    <screen
        android:screenDensity="mdpi"
        android:screenSize="small" />
    <screen
        android:screenDensity="hdpi"
        android:screenSize="small" />
    <screen
        android:screenDensity="xhdpi"
        android:screenSize="small" />
    <screen
        android:screenDensity="445"
        android:screenSize="small" />
    <screen
        android:screenDensity="480"
        android:screenSize="small" />

    <!-- all normal size screens -->
    <screen
        android:screenDensity="ldpi"
        android:screenSize="normal" />
    <screen
        android:screenDensity="mdpi"
        android:screenSize="normal" />
    <screen
        android:screenDensity="hdpi"
        android:screenSize="normal" />
    <screen
        android:screenDensity="xhdpi"
        android:screenSize="normal" />
    <!-- Nexus 5 : 445ppi -->
    <screen
        android:screenDensity="445"
        android:screenSize="normal" />
    <screen
        android:screenDensity="480"
        android:screenSize="normal" />
    <!-- all large size screens -->

    <screen
        android:screenDensity="ldpi"
        android:screenSize="large" />
    <screen
        android:screenDensity="mdpi"
        android:screenSize="large" />
    <screen
        android:screenDensity="hdpi"
        android:screenSize="large" />
    <screen
        android:screenDensity="xhdpi"
        android:screenSize="large" />
    <screen
        android:screenDensity="445"
        android:screenSize="large" />
    <screen
        android:screenDensity="480"
        android:screenSize="large" />
    <!-- all x large size screens -->

    <screen
        android:screenDensity="ldpi"
        android:screenSize="xlarge" />
    <screen
        android:screenDensity="mdpi"
        android:screenSize="xlarge" />
    <screen
        android:screenDensity="hdpi"
        android:screenSize="xlarge" />
    <screen
        android:screenDensity="xhdpi"
        android:screenSize="xlarge" />
    <screen
        android:screenDensity="445"
        android:screenSize="xlarge" />
    <screen
        android:screenDensity="480"
        android:screenSize="xlarge" />
</compatible-screens>

<supports-screens
    android:anyDensity="true"
    android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:xlargeScreens="true" />

谁知道这个问题,请告诉我,非常感谢。

Who know this problem, please tell me, Thanks so much.

P / S:其次 screens_support 而不是作品也

p/s : Followed screens_support but not works also.

推荐答案

所有的XML文件,应该为它定义背景色,它会解决这个问题:

In all your xml files, should define the background color for it, it will solve the problem :

将此的android:背景=@机器人:彩色/黑白,在您定义的视图标签

P / S:这个问题从发生使用片段在项目

P / S:此情况下,只有避免背景,重叠

这篇关于在Nexus 5重叠的背景(和重叠的图像)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆