我只是想知道,是否可以在不改变背景的情况下切换活动?
也许像,在所有活动后面添加一个大尺寸的背景并将活动背景设置为透明。有可能做到吗?
另外,我希望如果我在活动之间放置幻灯片过渡,我希望背景保持静止,而其他组件(如文本字段、按钮等)进行过渡。有可能做到吗?
我只是想知道,是否可以在不改变背景的情况下切换活动?
也许像,在所有活动后面添加一个大尺寸的背景并将活动背景设置为透明。有可能做到吗?
另外,我希望如果我在活动之间放置幻灯片过渡,我希望背景保持静止,而其他组件(如文本字段、按钮等)进行过渡。有可能做到吗?
你怎么能做到这一点?
1)创建扩展Activity的BaseActivity
2)您的所有活动都将扩展 BaseActivity
3)在您的 BaseActivity 覆盖 setContentView() 方法
@Override
    public void setContentView(int resId) {
        LayoutInflater inflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        inflater.inflate(resId, getContentView());
        this.setContentView(getContentView());
    }
private LinearLayout getContentView() {
            LinearLayout contentView = new LinearLayout(this);
            contentView.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT, 1.0f));
            contentView.setOrientation(LinearLayout.VERTICAL);
                    convertView.setBackGround(); // your common background for all activities
        return contentView;
    }
您可以添加一个主题,作为应用程序中所有屏幕的背景。
<application android:theme="@style/MyTheme"....>
 //all activities
</application>