Ich versuche, Hintergrund mit Vollbild zu erstellen, aber nur ein graues Quadrat haben.Problem mit Hintergrundbild
ich hinzufügen Bild in Projekt die neue/Image-Asset von Android Studio verwenden.
Aktivität Layout
<?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="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"
android:background="@drawable/mainbackground"
tools:context="com.imagenia.rollaction.rollaction.MainActivity">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Al menu"
android:id="@+id/boton"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true" />
</RelativeLayout>
Manifest // Ich wechsle das Thema
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen">
<activity
android:name=".MainActivity"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ActividadPrincipal"
android:screenOrientation="landscape">
</activity>
</application>
ED IT
Ich versuche, direkt PNG-Datei, in Android-Bild-Taste hinzufügen. aber haben ein sema-problem, die bild-taste sind grau-quadrat.
Verwenden Sie PNG-Bild? –
Ja, Android Studio meine JPEG in PNG-Datei ändern. –