Ich habe ein Android-Layout, das für die Anzeige eines "über App" -Meldungsdialogs mit einer Schaltfläche "Schließen" verwendet wird. Es hat einen Titel in fett zentriert, die App-Version und den Namen des Entwicklers. Alles sieht gut aus, abgesehen davon, dass sich oberhalb des Titels ein sehr deutlicher Rand/Abstand befindet und ich diesen leeren Platz nicht entfernen kann.Android-Warndialog leeren Bereich oben entfernen
Hier ist das Layout:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView android:orientation="vertical" android:scrollbars="none" android:layout_width="fill_parent" android:layout_height="wrap_content" xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginRight="6.0dp" xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" android:layout_gravity="center">
<TextView android:textSize="16.0dip" android:textStyle="bold" android:textColor="#ffffffff" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="6.0dip" android:layout_marginRight="6.0dip" android:layout_marginBottom="10.0dip" android:text="@string/app_name" />
</LinearLayout>
<LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal">
<TextView android:textSize="14.0dip" android:textColor="#ffffffff" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="6.0dip" android:layout_marginTop="0.0dip" android:text="@string/version_text" />
<TextView android:textSize="14.0dip" android:textColor="#ffffffff" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="6.0dip" android:layout_marginTop="0.0dip" android:text="@string/app_version" />
</LinearLayout>
<LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical">
<TextView android:textSize="14.0dip" android:textColor="#ffffffff" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="6.0dip" android:text="@string/about_developer" />
</LinearLayout>
<LinearLayout android:gravity="center" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="10.0dip" xmlns:android="http://schemas.android.com/apk/res/android">
<Button android:id="@id/close_btn" android:layout_width="110.0dip" android:layout_height="44.0dip" android:layout_marginTop="4.0dip" android:layout_marginBottom="4.0dip" android:text="@string/about_close" />
</LinearLayout>
</LinearLayout>
</ScrollView>
Und hier ist es, was es zeigt:
Ich habe android:layout_marginTop="-10.0dip"
Attribut in vielen Tags versucht, das Hinzufügen und SO für ein ähnliches Problem gesucht, aber ich kann‘ t finde es. Ich wäre dankbar, wenn mir jemand zeigt, wie dieses Problem gelöst wird.
ich mit der gleichen Antwort auf halbem Weg war. Gut gemacht. –
Ich versuche, Ihre Antwort anwenden und Android Studio sagt mir, dass "MainActivity ist keine einschließende Klasse" irgendwelche Ideen? Bitte helfen Sie. –
bearbeitet! stell den Kontext! – DevAndroid