Source Code: https (Kolon Slash Slash) Github (dot) com/rileyclauss/PHSMobileAndroid App Text Ghosting
Android Studio Text Gespenster auf dem Bildschirm beim Bau.
Beim Erstellen meiner Anwendung, [SEE EDIT 3], wenn ich scrolle, bleibt der Text vollständig transparent, so dass es unmöglich ist, Text zu lesen. [Bestimmte Aspekte sind auch visuelle Kauderwelsch, Bilder "Kachelung", statisch usw.) Dies tritt bei jeder Aktivität auf, unabhängig vom Inhalt des Codes (auch wenn dieser leer ist).
Dieses Beispiel zeigt das Problem : normal text im Gegensatz zu dem, wie es jetzt aussieht, torn text
Gibt es eine Lösung dafür? Der einzige Code, der ausgeführt wird, ist, das Layout so einzustellen, dass es kein Speicherproblem ist. Jede Hilfe würde sehr geschätzt werden.
EDIT1: Hier ist die Java-Code, den ich
bin mitpackage com.phsapp.phsapp;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
public class aboutActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) { //Yeah, this is it
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);
}
}
und die XML ist hier:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_about"
android:layout_width="match_parent"
android:layout_height="match_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.phsapp.phsapp.aboutActivity">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/textView56">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:weightSum="1">
<Space
android:layout_width="1dp"
android:layout_height="5dp"/>
<TextView
android:text="@string/introtext"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView57" />
<Space
android:layout_width="1dp"
android:layout_height="5dp"/>
<TextView
android:text="@string/introtext2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView58" />
<Space
android:layout_width="1dp"
android:layout_height="5dp"/>
<TextView
android:text="@string/introstats"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView59" />
<Space
android:layout_width="1dp"
android:layout_height="5dp"/>
<TextView
android:text="@string/introtext3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView60" />
<Space
android:layout_width="1dp"
android:layout_height="5dp"/>
<TextView
android:text="@string/points_of_pride"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView61"
android:textStyle="normal|bold"
android:textSize="16sp" />
<Space
android:layout_width="1dp"
android:layout_height="5dp"/>
<TextView
android:text="@string/POP1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView62" />
<Space
android:layout_width="1dp"
android:layout_height="5dp"/>
<TextView
android:text="@string/POP2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView63" />
<Space
android:layout_width="1dp"
android:layout_height="5dp"/>
<TextView
android:text="@string/POP3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView64" />
<Space
android:layout_width="1dp"
android:layout_height="5dp"/>
<TextView
android:text="@string/POP4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView65" />
<Space
android:layout_width="1dp"
android:layout_height="5dp"/>
<TextView
android:text="@string/POP5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView66" />
<Space
android:layout_width="1dp"
android:layout_height="5dp"/>
<TextView
android:text="@string/POP6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView67" />
<Space
android:layout_width="1dp"
android:layout_height="5dp"/>
<TextView
android:text="@string/quick_facts"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView68"
android:textStyle="normal|bold"
android:textSize="16sp" />
<Space
android:layout_width="1dp"
android:layout_height="5dp"/>
<TextView
android:text="@string/enrollmentfact"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView69" />
<Space
android:layout_width="1dp"
android:layout_height="5dp"/>
<TextView
android:text="@string/tasfact"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView70" />
<Space
android:layout_width="1dp"
android:layout_height="5dp"/>
<TextView
android:text="@string/schedule"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView71" />
<Space
android:layout_width="1dp"
android:layout_height="5dp"/>
<TextView
android:text="@string/schoolcolors"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView72" />
<Space
android:layout_width="1dp"
android:layout_height="5dp"/>
<TextView
android:text="@string/mascot"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView73" />
<Space
android:layout_width="1dp"
android:layout_height="5dp"/>
<TextView
android:text="@string/constructed_1958"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView74" />
<Space
android:layout_width="1dp"
android:layout_height="5dp"/>
<TextView
android:text="@string/extensively_renovated_1996"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView75" />
<Space
android:layout_width="1dp"
android:layout_height="5dp"/>
<TextView
android:text="@string/buildingsize"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView76" />
<Space
android:layout_width="1dp"
android:layout_height="5dp"/>
<TextView
android:text="@string/class_structure"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView77" />
<Space
android:layout_width="1dp"
android:layout_height="5dp"/>
<TextView
android:text="@string/schoolschedule"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView78" />
<Space
android:layout_width="1dp"
android:layout_height="20dp"/>
<Button
android:text="Credits"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/button3"
android:layout_weight="0.05" />
</LinearLayout>
</ScrollView>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:srcCompat="@drawable/abouthead"
android:id="@+id/imageView3"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:cropToPadding="true"
android:adjustViewBounds="true"
android:contentDescription="@string/abouttext" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView56"
android:text="@string/comittedexcelence"
android:textSize="18sp"
android:textStyle="normal|bold"
android:textAlignment="center"
android:layout_below="@+id/imageView3"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
Jeder String-Ressource extrahiert wird.
Android Studio 2.3
Build # AI-162,3764568, am 24. Februar gebaut 2017
JRE: 1.8.0_112-release-b06 amd64
JVM: OpenJDK 64-Bit Server VM durch JetBrains sro
In diesem Code habe ich festgestellt, dass es auch in Android Studio selbst reißt. Ist das möglicherweise ein Problem mit meinem Computer?
OS: Windows 10, bauen 14393
CPU: Intel Xeon 4-Core-2.67GHz
Speicher: 16 GB
EDIT 3: Nach ein wenig mehr Tests, ich konnte feststellen, Dies tritt nur auf Geräten auf, die ihre Grafik nicht zum Rendern des Bildschirms verwenden. Mit einem Nexus 5X (Android 7.1.2) zum Beispiel, ohne die GPU zur Verwendung zu zwingen, würde die GPU nicht verwendet werden und die CPU würde versuchen, alles zu rendern, was fehlschlägt und bewirkt, was oben zu sehen ist. Tests auf einem Samsung Galaxy S7 (Android 7.0) verwendet natürlich GPU, und alles sieht so aus, wie es sollte. In einer Moto E 2nd Gen (Android 7.1.2) muss Force GPU Rendering aktiviert sein, damit es richtig funktioniert. Ich habe (Android: hardwareAccelerated = "true") in mein Android-Manifest eingefügt, aber ohne Erfolg bleibt das Problem bestehen. Dieses Problem tritt auch in der IDE selbst auf. Im Modus "Design" einer XML-Datei verursacht das Scrollen dasselbe Problem. Text wird gezeichnet, aber nicht gelöscht. Dies geschieht sowohl auf einem Low-Tier- als auch Mid-Tier-Computer. Jede Lösung oder Workaround ist mehr als willkommen.
machst du etwas Besonderes in deinem Code? wie überschreiben ** onDraw ** :) – waqaslam
@waqaslam Nein, ich mache nichts in meinem Code, wie Sie oben sehen können. –
Verwenden Sie Zeilenabstand –