Using PNG as background image — can't see it in design view [closed]









up vote
-1
down vote

favorite












I have a background I created on Sketch which I want to use as the UI for the app, where I'll just put in invisible buttons where they are on the .png file.



I have the file in my drawable, and an imageview in the app with its height and width set as match_parent. Using the glide library, I loaded the image which is like 3.7MB, into the imageview, and this works, when I'm using the app on my device or emulator. The problem is, I cannot see the .png as the background when I try to put the buttons on top of the .png, since it only loads once the app starts. I've read that you could try to convert to SVG, however, when I tried this, nothing shows up.



Is there any way where I could load the image as the background another way? Or is there another way I could make a UI, or is there a way I can just load the .png?



login_activity - text



llogin_activity - design



LoginActivity Class










share|improve this question















closed as off-topic by Hovercraft Full Of Eels, Billal Begueradj, stealthyninja, Mark Rotteveel, GhostCat Nov 11 at 12:03


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example." – Hovercraft Full Of Eels, Billal Begueradj, stealthyninja, Mark Rotteveel, GhostCat
If this question can be reworded to fit the rules in the help center, please edit the question.












  • Please don't include code as images. Include code as code. StackOverflow expects you to try to solve your own problem first, as your attempts help us to better understand what you want. Please edit the question to illustrate the specific problem you're having in a Minimal, Complete, and Verifiable example. For more information, please see How to Ask and take the tour.
    – dmcgrandle
    Nov 11 at 1:49














up vote
-1
down vote

favorite












I have a background I created on Sketch which I want to use as the UI for the app, where I'll just put in invisible buttons where they are on the .png file.



I have the file in my drawable, and an imageview in the app with its height and width set as match_parent. Using the glide library, I loaded the image which is like 3.7MB, into the imageview, and this works, when I'm using the app on my device or emulator. The problem is, I cannot see the .png as the background when I try to put the buttons on top of the .png, since it only loads once the app starts. I've read that you could try to convert to SVG, however, when I tried this, nothing shows up.



Is there any way where I could load the image as the background another way? Or is there another way I could make a UI, or is there a way I can just load the .png?



login_activity - text



llogin_activity - design



LoginActivity Class










share|improve this question















closed as off-topic by Hovercraft Full Of Eels, Billal Begueradj, stealthyninja, Mark Rotteveel, GhostCat Nov 11 at 12:03


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example." – Hovercraft Full Of Eels, Billal Begueradj, stealthyninja, Mark Rotteveel, GhostCat
If this question can be reworded to fit the rules in the help center, please edit the question.












  • Please don't include code as images. Include code as code. StackOverflow expects you to try to solve your own problem first, as your attempts help us to better understand what you want. Please edit the question to illustrate the specific problem you're having in a Minimal, Complete, and Verifiable example. For more information, please see How to Ask and take the tour.
    – dmcgrandle
    Nov 11 at 1:49












up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











I have a background I created on Sketch which I want to use as the UI for the app, where I'll just put in invisible buttons where they are on the .png file.



I have the file in my drawable, and an imageview in the app with its height and width set as match_parent. Using the glide library, I loaded the image which is like 3.7MB, into the imageview, and this works, when I'm using the app on my device or emulator. The problem is, I cannot see the .png as the background when I try to put the buttons on top of the .png, since it only loads once the app starts. I've read that you could try to convert to SVG, however, when I tried this, nothing shows up.



Is there any way where I could load the image as the background another way? Or is there another way I could make a UI, or is there a way I can just load the .png?



login_activity - text



llogin_activity - design



LoginActivity Class










share|improve this question















I have a background I created on Sketch which I want to use as the UI for the app, where I'll just put in invisible buttons where they are on the .png file.



I have the file in my drawable, and an imageview in the app with its height and width set as match_parent. Using the glide library, I loaded the image which is like 3.7MB, into the imageview, and this works, when I'm using the app on my device or emulator. The problem is, I cannot see the .png as the background when I try to put the buttons on top of the .png, since it only loads once the app starts. I've read that you could try to convert to SVG, however, when I tried this, nothing shows up.



Is there any way where I could load the image as the background another way? Or is there another way I could make a UI, or is there a way I can just load the .png?



login_activity - text



llogin_activity - design



LoginActivity Class







java android android-studio svg png






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 11 at 2:21









Greenonline

1,02621424




1,02621424










asked Nov 11 at 0:04









iCodedYou

13




13




closed as off-topic by Hovercraft Full Of Eels, Billal Begueradj, stealthyninja, Mark Rotteveel, GhostCat Nov 11 at 12:03


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example." – Hovercraft Full Of Eels, Billal Begueradj, stealthyninja, Mark Rotteveel, GhostCat
If this question can be reworded to fit the rules in the help center, please edit the question.




closed as off-topic by Hovercraft Full Of Eels, Billal Begueradj, stealthyninja, Mark Rotteveel, GhostCat Nov 11 at 12:03


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example." – Hovercraft Full Of Eels, Billal Begueradj, stealthyninja, Mark Rotteveel, GhostCat
If this question can be reworded to fit the rules in the help center, please edit the question.











  • Please don't include code as images. Include code as code. StackOverflow expects you to try to solve your own problem first, as your attempts help us to better understand what you want. Please edit the question to illustrate the specific problem you're having in a Minimal, Complete, and Verifiable example. For more information, please see How to Ask and take the tour.
    – dmcgrandle
    Nov 11 at 1:49
















  • Please don't include code as images. Include code as code. StackOverflow expects you to try to solve your own problem first, as your attempts help us to better understand what you want. Please edit the question to illustrate the specific problem you're having in a Minimal, Complete, and Verifiable example. For more information, please see How to Ask and take the tour.
    – dmcgrandle
    Nov 11 at 1:49















Please don't include code as images. Include code as code. StackOverflow expects you to try to solve your own problem first, as your attempts help us to better understand what you want. Please edit the question to illustrate the specific problem you're having in a Minimal, Complete, and Verifiable example. For more information, please see How to Ask and take the tour.
– dmcgrandle
Nov 11 at 1:49




Please don't include code as images. Include code as code. StackOverflow expects you to try to solve your own problem first, as your attempts help us to better understand what you want. Please edit the question to illustrate the specific problem you're having in a Minimal, Complete, and Verifiable example. For more information, please see How to Ask and take the tour.
– dmcgrandle
Nov 11 at 1:49












1 Answer
1






active

oldest

votes

















up vote
0
down vote



accepted










Android Studio has the nifty tools namespace.



If you add



tools:src="@drawable/loginscreen"


to your ImageView in XML, the design view will show the image, but the attribute will be ignored during compile time and won't be present in the APK itself.



tools: also works for most XML attributes.



You may need to import the tools namespace (click the red tools text and hit Alt+Enter).






share|improve this answer




















  • I can't believe that was all it needed, thanks babe. So when I run the app on my phone, it will be ignored right?
    – iCodedYou
    Nov 11 at 0:25

















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote



accepted










Android Studio has the nifty tools namespace.



If you add



tools:src="@drawable/loginscreen"


to your ImageView in XML, the design view will show the image, but the attribute will be ignored during compile time and won't be present in the APK itself.



tools: also works for most XML attributes.



You may need to import the tools namespace (click the red tools text and hit Alt+Enter).






share|improve this answer




















  • I can't believe that was all it needed, thanks babe. So when I run the app on my phone, it will be ignored right?
    – iCodedYou
    Nov 11 at 0:25














up vote
0
down vote



accepted










Android Studio has the nifty tools namespace.



If you add



tools:src="@drawable/loginscreen"


to your ImageView in XML, the design view will show the image, but the attribute will be ignored during compile time and won't be present in the APK itself.



tools: also works for most XML attributes.



You may need to import the tools namespace (click the red tools text and hit Alt+Enter).






share|improve this answer




















  • I can't believe that was all it needed, thanks babe. So when I run the app on my phone, it will be ignored right?
    – iCodedYou
    Nov 11 at 0:25












up vote
0
down vote



accepted







up vote
0
down vote



accepted






Android Studio has the nifty tools namespace.



If you add



tools:src="@drawable/loginscreen"


to your ImageView in XML, the design view will show the image, but the attribute will be ignored during compile time and won't be present in the APK itself.



tools: also works for most XML attributes.



You may need to import the tools namespace (click the red tools text and hit Alt+Enter).






share|improve this answer












Android Studio has the nifty tools namespace.



If you add



tools:src="@drawable/loginscreen"


to your ImageView in XML, the design view will show the image, but the attribute will be ignored during compile time and won't be present in the APK itself.



tools: also works for most XML attributes.



You may need to import the tools namespace (click the red tools text and hit Alt+Enter).







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 11 at 0:12









TheWanderer

6,26121026




6,26121026











  • I can't believe that was all it needed, thanks babe. So when I run the app on my phone, it will be ignored right?
    – iCodedYou
    Nov 11 at 0:25
















  • I can't believe that was all it needed, thanks babe. So when I run the app on my phone, it will be ignored right?
    – iCodedYou
    Nov 11 at 0:25















I can't believe that was all it needed, thanks babe. So when I run the app on my phone, it will be ignored right?
– iCodedYou
Nov 11 at 0:25




I can't believe that was all it needed, thanks babe. So when I run the app on my phone, it will be ignored right?
– iCodedYou
Nov 11 at 0:25



Popular posts from this blog

Use pre created SQLite database for Android project in kotlin

Darth Vader #20

Ondo