0

eclipse New--> other--> Android Activity --> New Login Activity で作成された標準のログイン アクティビティがあります。

(同じアクティビティを作成してみてください...「Eclipseバージョン:Juno Service Release 1」を使用しています)

#0099cc のすべてのバックグラウンド アクティビティ/フラグメントを変更しました

しかし、アクティビティから別のアクティビティに移ると、画像のように背景が白くなります。

手伝って頂けますか?

重要なコードは次のとおりだと思います。

showProgress(真);

    /**
 * Shows the progress UI and hides the login form.
 */

@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
private void showProgress(final boolean show) {
    // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow
    // for very easy animations. If available, use these APIs to fade-in
    // the progress spinner.
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {
        int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);

        mLoginStatusView.setVisibility(View.VISIBLE);

                    **I tried in this way**
        mLoginStatusView.setBackgroundColor(Color.parseColor("#0099cc"));
        mLoginStatusView.animate().setDuration(shortAnimTime).alpha(show ?1 : 0).setListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
                        mLoginStatusView.setVisibility(show? View.VISIBLE : View.GONE); }
        });
        mLoginFormView.setVisibility(View.VISIBLE);
        mLoginFormView.animate().setDuration(shortAnimTime).alpha(show ? 0:1).setListener(new AnimatorListenerAdapter() {

        @Override
        public void onAnimationEnd(Animator animation) {
            mLoginFormView.setVisibility(show ? View.GONE:View.VISIBLE);
        }
                });
    } else {
        // The ViewPropertyAnimator APIs are not available, so simply show
        // and hide the relevant UI components.
        mLoginStatusView.setVisibility(show ? View.VISIBLE : View.GONE);
        mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);
    }
}

login.xml レイアウトで

        <ProgressBar
        style="?android:attr/progressBarStyleLarge"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="8dp"
        android:background="#0099cc" />

attrs.xml で

<!--
     Declare custom theme attributes that allow changing which styles are
     used for button bars depending on the API level.
     ?android:attr/buttonBarStyle is new as of API 11 so this is
     necessary to support previous API levels.
-->
<declare-styleable name="ButtonBarContainerTheme">
    <attr name="buttonBarStyle" format="reference" />
    <attr name="buttonBarButtonStyle" format="reference" />
</declare-styleable>

ロギング活動

背景を変更したい場所

4

2 に答える 2

0

アプリケーション全体に独自のスタイルを記述する必要があると思います。Googleの API ガイドを次に示します。

于 2013-02-19T14:09:57.370 に答える
0

私は(多くの方法でスタイルを管理しようとした後)私の問題を解決し、単純な行を追加しました:

getWindow().getDecorView().setBackgroundColor(Color.parseColor("#0099cc"));

    /**
     * Shows the progress UI and hides the login form.
     */
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
private void showProgress(final boolean show) {
    // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow
    // for very easy animations. If available, use these APIs to fade-in
    // the progress spinner.

    getWindow().getDecorView().setBackgroundColor(Color.parseColor("#0099cc"));
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {
        ...
于 2013-02-19T16:25:05.490 に答える