截图 screenshot
关于此更改
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="ir.diamonddesign.tajrobi96.MainActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@android:color/holo_red_dark"
app:popupTheme="@style/AppTheme.PopupOverlay"
/>
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_main" />
</android.support.design.widget.CoordinatorLayout>
关于这不要改变
/*
<?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"
tools:context="ir.diamonddesign.tajrobi96.Questionsactivity"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15dp"
android:textAppe``arance="?android:attr/textAppearanceLarge"
android:text="@string/kharej_text"
android:id="@+id/textView2"
android:textDirection="rtl"
android:layout_alignTop="@+id/textView3"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="@string/dakhel_text"
android:textSize="15dp"
android:id="@+id/textView3"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="false"
android:textDirection="rtl" />
</RelativeLayout>*/
答案 0 :(得分:2)
在res文件夹中找到名为styles.xml的文件。 您应该已经为项目定义了一个主题,如下面的代码
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/text_description</item>
<item name="colorPrimaryDark">@color/black</item>
<item name="colorAccent">@color/theme_teal</item>
</style>
这里,colorPrimary定义了actionBar的颜色。必须根据屏幕截图将此颜色设置为蓝色。 尝试将colorPrimary值更改为所需的所需颜色。
答案 1 :(得分:0)
更改style.xml:
<item name="colorPrimary">@color/colorPrimary</item>
到:
<item name="colorPrimary">@android:color/holo_red_dark</item>