Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linear Layout background color

I am trying to change the background of whole screen to white. I doing it by adding by android:background="#ffffff" attribute to linerlayout. but it is not working, i dont know what i am missing ?

http://developer.android.com/reference/android/widget/LinearLayout.html

xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:padding="10dip"
android:layout_width="fill_parent" android:layout_height="wrap_content"
**android:background="#ffffff"** >

I also tried to this programtically , something like this setContentView(R.layout.main); LinearLayout linLay = (LinearLayout) findViewById(R.layout.main);
linLay.setBackgroundColor(Color.WHITE);

but application throws error

like image 611
Gainster Avatar asked Oct 29 '25 21:10

Gainster


1 Answers

Are you please able to post the complete code necessary to replicate your problem?

This works fine for me:

<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="#FFFFFF">
like image 188
Thane Anthem Avatar answered Oct 31 '25 10:10

Thane Anthem