my glass project is coming along great.
I am wondering if it is possible to change the background color of a view. I am using an immersion and my entire app runs on that single view. The entire view is a relative layout.
I originally tried to this from code by defining my relative layout and doing: rl.setBackgroundColor(color.empty_gray);
But not change occured when this code was called. Then I tried adding it directly to the XML element with android:background="@color/warning_red"
which also yielded nothing.
Is it impossible to change the background color of the view? I know you can set a picture background in a card but the immersion really works much better for my application. Can I set a picture background with a color, would that work?
Here is my entire relative layout setup:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/rel_layout"
android:layout_width="fill_parent"
android:layout_height="fill_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"
android:keepScreenOn="true"
android:background="@color/warning_red"
tools:context=".MainActivity" >
Any help or workaround would be appreciated.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…