2017-07-14 6 views
0

私の質問はおそらく愚かですが、私は初心者です 私は2つのアクティビティでAndroidスタジオでナビゲーションの引き出しアプリケーションを作成しています。最初のアクティビティ(MainActivity)では、このアクティビティはタイトルバーを表示しますが、2番目のアクティビティ(Parametre)はタイトルバーを表示しません。 Hier ist my code。タイトルを表示するにはアクティビティのバーを

Androidmanifest.xml 

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
package="com.pandl.fragment"> 

<application 
    android:allowBackup="true" 
    android:icon="@mipmap/ic_launcher" 
    android:label="@string/app_name" 
    android:supportsRtl="true" 
    android:theme="@style/AppTheme"> 
    <activity 
     android:name=".MainActivity" 
     android:label="@string/app_name" 
     android:theme="@style/AppTheme.NoActionBar"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 
    <activity android:name=".SingleViewActivity"></activity> 

    <activity android:name=".Playboard"></activity> 
    <activity 
     android:name=".Parametre" 


     android:label="Parametre"></activity> 

    <meta-data 
     android:name="com.google.android.gms.version" 
     android:value="@integer/google_play_services_version" /> 

    </application> 

    </manifest> 

      styles.xml 


       <resources> 

       <!-- Base application theme. --> 

       <style name="AppTheme" 
    parent="Theme.AppCompat.Light.DarkActionBar"> 
        <!-- Customize your theme here. --> 
        <item name="colorPrimary">@color/colorPrimary</item> 
        <item 
    name="colorPrimaryDark">@color/colorPrimaryDark</item> 
        <item name="colorAccent">@color/colorAccent</item> 
       </style> 

       <style name="AppTheme.NoActionBar"> 
        <item name="windowActionBar">false</item> 
        <item name="windowNoTitle">true</item> 
       </style> 

       <style name="BaseTheme" parent="AppTheme"> 
        <item name="windowActionBar">false</item> 
        <item name="windowNoTitle">true</item> 
       </style> 

       <style name="AppTheme.AppBarOverlay" 
    parent="ThemeOverlay.AppCompat.Dark.ActionBar" /> 

       <style name="AppTheme.PopupOverlay" 
    parent="ThemeOverlay.AppCompat.Light" /> 

      </resources> 

答えて

1

変更ラインandroid:theme="@style/AppTheme.NoActionBar"を削除android:theme="@style/AppTheme.NoActionBar">

1

この行を削除することによって、あなたの活動のスタイル。あなたは、あなたのJavaコードで

extends Activity 

extends AppCompatActivity 

変更、それを使用している場合は、あなたのデフォルトActivity

0

どのように見えるかを確認するためにあなたのTheme editorに見たいと思うかもしれません。

+0

このコードをご利用いただきありがとうございます。 [適切な説明](https://meta.stackexchange.com/q/114762)は、これが問題の良い解決策である理由を示すことによって、長期的な価値を大幅に改善し、今後の読者にとって、同様の質問。あなたの前提を含め、あなたの答えをいくつかの説明を追加するには、[編集](https://meta.stackoverflow.com/posts/360251/edit)してください。 [ref](https://meta.stackoverflow.com/a/360251/8371915) – user8371915

関連する問題