Tuesday, August 16, 2011

Apply Colors to Android Controls and Layouts

Hi..Today i would like to share some stuff about desgining concept in Android development that is"Apply colors to android controls like (Buttons,Textviews,etc..) and applying Background colors to Different Layouts"..So lets start


First,Create an xml file in your project and change the name as colors.xml

Next,Save this file in values folder which under the res folder like this res/values/colors.xml

Next,Decide which colors you would like to add.

Next,Open the colors.Xml file and add the following code

Here, We are appying only Background colors




     #303030
     #000000
            #FFFFFF  
     #F0F0F0



Note: Change the colors as per your requirment

Now save this file and open another xml file to apply these colors to layouts

Open the Layout1.xml file and add the following code



 



//// Another Sub parent Layout’s



// these are the Child Layout’s



 





   

  



  

  


Note : you need to add this line (android:background="@color/completeBackground")

Next,Lets start appyling colors to Android controls

Again open the colors.xml file and add the following lines in the file



     #303030
     #000000
            #FFFFFF  
     #F0F0F0

            #000000
            #000000
            



Now save the file..and apply colors to Controls


Thats it..In this way we can apply colors to android controls and layouts


developercode
About the Author
Sayyad is a Software Engineer, Blogger and Founder of Developers Code from India.His articles mainly focus on .Net (Web and Windows based applications), Mobile Technologies (Android,IPhone,BlackBerry) and SEO.

Labels: , , , , ,

1 Comments:

At August 17, 2011 at 8:55 AM , Anonymous Anonymous said...

Thanks for sharing..........

 

Post a Comment

Subscribe to Post Comments [Atom]

<< Home