2016-10-08 4 views
1

は私のアプリの画像です:誰かが私のテキストの背景が私のツールバーで白である理由を教えてもらえますか?ここ

screenshot

ツールバーのテキストの背景を見ることができるように私はこの問題を解決できるか、ツールバーの背景とは異なる色に設定されていますか?

マニフェスト:

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

<application 
    android:allowBackup="true" 
    android:icon="@mipmap/ic_launcher" 
    android:label="@string/app_name" 
    android:supportsRtl="true" 
    android:theme="@style/AppTheme"> 
    <meta-data 
     android:name="android.app.searchable" 
     android:resource="@xml/searchable" /> 

    <activity android:name=".main.MainActivity"> 

    </activity> 
    <activity android:name=".viewdatabase.ViewDatabase"> 
     <meta-data 
      android:name="android.app.searchable" 
      android:resource="@xml/searchable" /> 
    </activity> 
    <activity android:name=".viewmeals.ViewMeals" /> 
    <activity android:name=".viewkitchen.ViewKitchen" /> 
    <activity 
     android:name=".main._MainActivity" 
     android:label="@string/title_activity___main" > 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

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

主レイアウト:

<?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" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
tools:context="com.mddri_.myeats.main._MainActivity"> 

<android.support.v7.widget.Toolbar 
    android:id="@+id/my_toolbar" 
    android:layout_width="match_parent" 
    android:layout_height="?attr/actionBarSize" 
    android:background="?attr/colorPrimary" 
    android:elevation="4dp" 
    android:theme="@style/ThemeOverlay.AppCompat.ActionBar" 
    app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/> 

<android.support.design.widget.TabLayout 
    android:id="@+id/tab_layout" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    app:tabMode="scrollable" 
    android:layout_below="@+id/my_toolbar" 
    android:background="@color/colorPrimary" 
    /> 
<android.support.v4.view.ViewPager 
    android:id="@+id/pager" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:layout_below="@+id/tab_layout"/> 

スタイル:

<resources> 

<!-- Base application theme. --> 
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!--.Light.DarkActionBar--> 
    <!-- Customize your theme here. --> 
    <item name="colorPrimary">@color/colorPrimary</item> 
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item> 
    <item name="colorAccent">@color/colorAccent</item> 
    <item name="android:background">@color/background</item> 
    <item name="android:textColor">@color/textColor</item> 
    <item name="android:editTextColor">@color/textColor</item> 
</style> 


</resources> 

色:

<?xml version="1.0" encoding="utf-8"?> 
<resources> 
<color name="colorPrimary">#C0FF3E</color> 
<color name="colorPrimaryDark">#04a314</color> 
<color name="colorAccent">#8a9b8c</color> 
<color name="textColor">#555555</color> 
<color name="background">#fcfcfc</color> 
</resources> 

ご協力いただきありがとうございます。

+1

テーマスタイルから背景色を削除してみてください。 –

+0

これはうまくいきました。ありがとうございます。 –

答えて

1

Sunilのように自分のスタイルファイルから<item name="android:background">@color/background</item>を削除してくれました。

関連する問題