First things first, I needed to set up the user interface. My goal was to get the first screen to look like this:
To do this, I needed to set up the background. After a while of researching, I learnt that to set the background I needed to go into my computer files to
>Users >Lily >AndroidStudioProjects >MyApplication5 >app >src >main >res >drawable-mdpi
then drag and drop (or paste) the image into the folder.
Now we go to Android App Studio where we will see that the image is now available to us:
We go to activity_main.xml and enter the following:
You can ignore the rest, all we really need to focus on is how it says android:background="@drawable/index" Realize that it is considered a drawable. Also keep in mind that your file name will be different. I wrote index after the / because the file name is index.jpg. If your file name is sky.jpg, then you would write android:background="@drawable/sky"
No comments:
Post a Comment