Meine Hauptaktivität (eine XML-Datei und eine Java-Datei) enthält eine Hilfeschaltfläche, und ich möchte das gesamte Layout (einschließlich des Absatzes in einer Textansicht eingegeben) nach dem Klicken angezeigt. Es wurde erfolgreich gestartet, alle Bildansichten wurden angezeigt, aber nicht die Textansicht.TextView nicht nach Aktivitätsschalter
Hier ist der Inhalt der XML-Datei:
<?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:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/tbs_background"
tools:context="limitless.the_bat_signal.aboutPage">
<TextView
tools:text="about the app"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/tbs_text_about"
android:textStyle="normal|italic"
android:textAlignment="center"
android:textColor="@android:color/darker_gray"
android:fontFamily="sans-serif"
android:layout_below="@+id/tbs_title_text"
android:layout_centerHorizontal="true"
tools:ignore="UnusedAttribute" />
<TextView
tools:text="@string/about"
android:id="@+id/tbs_text_aboutDetails"
android:layout_width="300dp"
android:textColor="@android:color/darker_gray"
android:textSize="16sp"
android:layout_height="wrap_content"
android:layout_below="@+id/tbs_text_about"
android:layout_centerHorizontal="true"
android:layout_marginTop="12dp" />
<ImageView
android:layout_height="wrap_content"
app:srcCompat="@drawable/tbs_title_text"
android:id="@+id/tbs_title_text"
android:adjustViewBounds="true"
android:layout_width="250dp"
android:layout_below="@+id/tbs_icon"
android:layout_centerHorizontal="true"
tools:ignore="ContentDescription" />
<ImageView
app:srcCompat="@drawable/tbs_icon"
android:layout_marginTop="14dp"
android:id="@+id/tbs_icon"
android:layout_width="128dp"
android:layout_height="128dp"
tools:ignore="ContentDescription"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
<Button
android:id="@+id/tbs_home"
android:background="@drawable/tbs_home"
android:layout_width="56dp"
android:layout_height="56dp"
android:layout_alignParentBottom="true"
android:layout_toRightOf="@+id/tbs_title_text"
android:layout_toEndOf="@+id/tbs_title_text"
android:layout_marginBottom="10dp" />
</RelativeLayout>.
Dann 2 meine Aktivität aboutPage ruft die XML-Datei, die oben genannt:
public class aboutPage extends AppCompatActivity {
Button btn_help;
TextView tbs_title_text;
TextView tbs_text_about_details;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);
}
}.
Ich bin neu zu Android, mir bitte sagen, was Vermisse ich. Vielen Dank!
Vor allen Klassennamen für Konvention sind Großbuchstaben => AboutPage benannt werden. Bitte posten Sie den Hauptaktivitätscode – firegloves