これは私のxmlコードです:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/blue"
android:gravity="center">
アクティビティファイルから色を設定することはできますか?
たとえば、ボタンに対してこれを行うことができます。
ImageButton x = (ImageButton) this.findViewById(R.id.btn1);
x.setBackgroundColor(color);