Ich habe gerade ein neues Projekt in Android Studio v2.2.3 erstellt - ein Projekt Targeting API Level 15 und mit einer leeren Aktivität zu starten.Wo in Android-Projekt Menü für Aktivität
Die XML für diese Aktivität ist:
<?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:id="@+id/activity_starting"
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.bfsog.apps.testapp.StartingActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Lorem ipsum"/>
</RelativeLayout>
Im Vorschaufenster und wenn ich diese laufen, am oberen Rand des Bildschirms gibt es mit dem Namen meiner app und dann darunter ein blauer Balken ist, meine Textansicht.
Ich habe dann eine neue leere Aktivität, mit der gleichen XML aber etwas anders Text:
<?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:id="@+id/activity_display_notification"
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.bfsog.apps.testapp.SecondActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ipsum lorem"/>
</RelativeLayout>
nun im Vorschaufenster für die zweite Aktivität ist es nicht die horizontale blaue Leiste am oberen Rande hat.
Wo ist das angegeben?
Edit: Mein Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.bfsog.apps.testapp">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".StartingActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".SecondActivity"
android:theme="@style/AppTheme">
</activity>
</application>
</manifest>
Die erste Aktivität ist nicht festgelegt, das Thema, aber es wird die blaue Leiste. Die zweite Aktivität gibt das Thema an, wird jedoch nicht angezeigt.
Es ist ActionBar, wofür brauchen Sie Hilfe? Versucht es zu entfernen? – OBX
Werkzeuge: Kontext, in der Regel Arten die Themen für diese Aktivität erforderlich, legen Sie das gleiche Thema für die zweite Aktivität in Manifest und sehen, sonst oben, sollte es so etwas wie Themen, überprüfen Sie es einmal – Redman
Sie müssen Themen im Stil definieren. XML. –