TaskDescription的主要颜色应该是不透明的

问题描述 投票:2回答:3

错误

java.lang.RuntimeException:无法启动活动ComponentInfo {com.example.vigneshbaskar.concavechat / com.example.vigneshbaskar.concavechat.MainActivity}:java.lang.RuntimeException:TaskDescription的主要颜色应该是不透明的

java的

package com.example.vigneshbaskar.concavechat;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
}

XML

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    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"
    tools:context="com.example.vigneshbaskar.concavechat.MainActivity">

</RelativeLayout>

表现

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

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name="com.example.vigneshbaskar.concavechat.MainActivity"
            android:theme="@style/FullTheme">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>
android
3个回答
1
投票

您不能在原色中使用Alpha,只是让您的主要颜色不透明。转到res>values>colors并用这个#3F51B5(蓝色)替换你的颜色主代码;


0
投票

styles/FullTheme.xml中,从@color/primaryColor定义中删除alpha通道。颜色的前两个数字是其alpha通道,例如#CCFF0000。删除CC(在此示例中)。


0
投票

好..!!这是因为原色不透明而导致的错误

转到你的res - > values - > color.xml

<color name="colorPrimary">#29FAB5CC</color>

删除任何两个字符

<color name="colorPrimary">#29F5CC</color>

or watch this simple and quick video

© www.soinside.com 2019 - 2024. All rights reserved.