• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Setting a Background

pmd5700

Newbie
I'm working an a simple app that has 1 Button and 1 Text view. I want to set it up so when I click the button the text changes and the background changes. I also want it so the background takes up the entire screen.

Right now I'm using 2 Image Views and 1 Text View. I'm using the Image Views for the backgrounds and the Text view for the text. When I click the button, the text changes and the background changes, but I want the background to fill the entire screen and be scaled correctly (constant aspect ratio).

Any ideas on how to do this?

Thanks!
 
I'm not sure if I'm understanding this question correctly, but if I am, I recomend trying this:
Instead of using the image view for the background, tryjust setting the background of your root parent (probobaly a linear/relative layout) and use the setBackground() method. Ex
LinearLayout layout = (LinearLayout) findViewById(R.id.LinearLayout01)
layout.setBackground(image)
Let me know if u need more help
 
I'm not sure if I'm understanding this question correctly, but if I am, I recomend trying this:
Instead of using the image view for the background, tryjust setting the background of your root parent (probobaly a linear/relative layout) and use the setBackground() method. Ex
LinearLayout layout = (LinearLayout) findViewById(R.id.LinearLayout01)
layout.setBackground(image)
Let me know if u need more help
Hi sam, im new to this forum, i need some help, i tried using your background coding but i kept gettin lots of errors.

"(probobaly a linear/relative layout) and use the setBackground() method. Ex
LinearLayout layout = (LinearLayout) findViewById(R.id.LinearLayout01)
layout.setBackground(image)"

I have to create an application for customers purchasing petrol on android and want to also ask do you know how i can use a marquee code to move a gallery or set of images, because i searched throug the internet but can only find marquees which move buttons or text across.
 
umm, I'm pretty sure there are gallery examples on developer.android.com, I'd check that out, I think what you're asking and what this question is are two completely different topics
 
Back
Top Bottom