2016-07-23 11 views
0

Android Noob hier nicht angezeigt.Android Image wird auf einigen Geräten

Ich verwende ein Bild in einer Bildansicht.

Bild Specs: 750x500 PNG 835.36kb

Es zeigt korrekt auf allen Geräte-Emulatoren und auf dem realen Gerät während des Debug. Nach der Veröffentlichung scheint es jedoch auf einigen Geräten nicht zu erscheinen.

Es ist Bild mit src 'main22', die die Probleme verursacht.

Jede Hilfe, die dies löst, würde sehr geschätzt werden!

Ich bin mit dem folgenden XML-Code:

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:paddingBottom="@dimen/activity_vertical_margin" 
    android:paddingLeft="@dimen/activity_horizontal_margin" 
    android:paddingRight="@dimen/activity_horizontal_margin" 
    android:paddingTop="@dimen/activity_vertical_margin" 
    tools:context="com.mattblack.fibreapp.MainActivity" 
    android:background="#000000"> 


    <ImageView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:id="@+id/imageView" 
     android:src="@drawable/main22" 
     android:layout_gravity="center_horizontal" 
     android:layout_above="@+id/frameLayout" 
     android:layout_alignParentLeft="false" 
     android:layout_alignParentStart="false" 
     android:adjustViewBounds="false" 
     android:cropToPadding="false" 
     android:layout_below="@+id/frameLayout6" 
     android:nestedScrollingEnabled="false" 
     android:scaleType="fitXY" /> 

    <FrameLayout 
     android:layout_width="match_parent" 
     android:layout_height="90dp" 
     android:background="#ffffff" 
     android:id="@+id/frameLayout" 
     android:layout_gravity="center_horizontal" 
     android:layout_above="@+id/frameLayout2" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentStart="false"> 

     <Button 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="INACTIVE" 
      android:id="@+id/qjumpButton" 
      android:layout_gravity="center" 
      android:textColor="#000000" 
      android:background="#ffffff" 
      android:textSize="30sp" 
      android:typeface="normal" 
      android:onClick="clickFunction" 
      android:enabled="true" 
      android:clickable="true" 
      style="?android:attr/borderlessButtonStyle" 
      android:textStyle="normal" 
      android:layout_marginBottom="15dp" /> 

     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Queue Jump" 
      android:id="@+id/textView2" 
      android:layout_gravity="center_horizontal|bottom" 
      android:textSize="20sp" 
      android:textColor="#e4c353" 
      android:layout_marginBottom="15dp" /> 

    </FrameLayout> 

    <FrameLayout 
     android:layout_width="match_parent" 
     android:layout_height="130dp" 
     android:id="@+id/frameLayout2" 
     android:layout_gravity="center_horizontal" 
     android:layout_above="@+id/frameLayout3" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentStart="true"> 

     <ImageView 
      android:layout_width="100dp" 
      android:layout_height="80dp" 
      android:id="@+id/shakeImage" 
      android:layout_gravity="center" 
      android:src="@drawable/shake" 
      android:visibility="visible" /> 

     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="WINNER!" 
      android:id="@+id/winnerText" 
      android:layout_gravity="center_horizontal" 
      android:textColor="#ffffff" 
      android:textSize="30sp" 
      android:visibility="invisible" 
      android:layout_marginTop="10dp" /> 

     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="1 x The Prize" 
      android:id="@+id/prizeText" 
      android:layout_gravity="center" 
      android:textColor="#ffffff" 
      android:textSize="20sp" 
      android:visibility="invisible" /> 

     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Show at the Bar to Claim before we close." 
      android:id="@+id/claimText" 
      android:layout_gravity="center_horizontal|bottom" 
      android:textColor="#ffffff" 
      android:visibility="invisible" 
      android:layout_marginBottom="15dp" 
      android:textSize="12dp" /> 

     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="NO WIN" 
      android:id="@+id/nowinText" 
      android:layout_gravity="center_horizontal|top" 
      android:textColor="#ffffff" 
      android:textSize="40sp" 
      android:layout_marginTop="30dp" 
      android:visibility="invisible" /> 

     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Try Again Tomorrow." 
      android:id="@+id/tryagainText" 
      android:layout_gravity="center_horizontal|bottom" 
      android:textColor="#ffffff" 
      android:textSize="12sp" 
      android:layout_marginBottom="20dp" 
      android:visibility="invisible" /> 

     <Button 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:id="@+id/down" 
      android:layout_gravity="center" 
      android:alpha="0.1" 
      android:enabled="true" 
      android:clickable="true" 
      android:visibility="invisible" /> 

     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Shake Again Tomorrow." 
      android:id="@+id/shakeTomorrowText" 
      android:layout_gravity="center" 
      android:textSize="15sp" 
      android:textColor="#ffffff" 
      android:visibility="invisible" /> 

    </FrameLayout> 

    <FrameLayout 
     android:layout_width="match_parent" 
     android:layout_height="40dp" 
     android:background="#ffffff" 
     android:layout_gravity="bottom" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentStart="true" 
     android:id="@+id/frameLayout3"> 

     <Button 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="HOME" 
      android:id="@+id/button" 
      android:layout_gravity="left|center_vertical" 
      android:background="#ffffff" /> 

     <Button 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="CODE" 
      android:id="@+id/button9" 
      android:layout_gravity="right|center_vertical" 
      android:background="#ffffff" 
      android:onClick="profilePageClick" /> 
    </FrameLayout> 

    <FrameLayout 
     android:layout_width="match_parent" 
     android:layout_height="45dp" 
     android:layout_alignParentBottom="false" 
     android:layout_centerHorizontal="true" 
     android:layout_alignParentStart="false" 
     android:layout_alignParentTop="true" 
     android:background="#ffffff" 
     android:id="@+id/frameLayout6"> 

     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="FIBRE" 
      android:id="@+id/textView" 
      android:layout_gravity="center" 
      android:textSize="25sp" 
      android:textColor="#d9bc00" /> 
    </FrameLayout> 


</RelativeLayout> 
+0

In welches Unterverzeichnis unterhalb von res/haben Sie das Bild gelegt? Normales Zeichen, Mipmap oder Zeichen-? – Thomas

+0

ausklappbar - einfach zu zeichnen, habe ich etwas googeln gemacht, hat es etwas mit verschiedenen Dateipfaden zu tun? – MattBlack

+0

Mit Qualifizierern können Sie Ressourcen in bestimmten Varianten bereitstellen, z. B. kann eine Hires-Version eines Bilds auf "drawable-hdpi" verweisen, während eine Version mit niedriger Dichte des gleichen Bilds auf "drawable-ldpi" verweist. Einfaches Zeichnen dient jedoch als Fallback. Wenn Sie also ein Bild kopieren, wird es auf allen Geräten verwendet. Wie du es getan hast, sollte das leider nicht der Grund sein, dass du auf einigen Geräten nicht auftauchst. Es tut uns leid. – Thomas

Antwort

0

ich das gleiche Problem gegenüber. In meinem Fall war das Bild sehr groß und das war der Grund, warum das Bild nicht auf einem Gerät angezeigt wurde. Reduzieren Sie einfach die Bildgröße und es wird funktionieren.

Verwandte Themen