I'm using an image with transparency as a ImageButton in my Android app - but when it appears on the android screen - it still has a whitish surrounding border.
I even changed the image to one of the template ones supplied and that still is not transparent (although it is in photoshop).
Am a missing some declaration or something ?
I tried in both the emulator and also running on my phone and its still shows as white on the black background.
Cheers
ScottyB
The whitish color IS the button part of the image button :)
Use regular Button and set your image as the android:background of it. Don't set any text.
Related
I am trying to remove the Grey and White Chequered background from a launcher icon jpg file using Android Studio's Image Asset.But no luck so far.
Is there any way to do this?
below is the Background :
The checkerboard background is for transparency. Same happens in paint.net. If you end up with transparency, you get a checkerboard like that of white and grey.
It is technically not a background, you don't actually see that in the launcher. Alpha shows as a checkerboard to ensure you know you are seeing alpha. If you install it on a device, you can see what is "under" the launcher icon. If your icon is 256x256, and has a 10x10 square of transparency in the middle, you will see a checkerboard there too. If you then launch it on the device and check the launcher, you will see that there is a see-through hole in the middle.
Basically, the checkerboard isn't a background - it is transparency.
With the exception of the times where you actually create a checkerboard on purpose, but that can then be deleted by modifying the .png file
Right-click on image, form the menu that pops up select Hide Chessboard.
So I've been working with Android Notifications and after setting a large image, I found out that my small image is actually not displaying properly.
As you can see on the following screenshot of the lockscreen, the background of the small icon is transparent. I want to set a specific colour there, just like the one Outlook.com is using:
Another example where the small icon shows next to the large one (please take notice of the small icon which is actually displaying, but not really noticable because there is just no background):
I've been thinking about changing the small icon to include the background colour, but obviously the colour would also be shown in the statusbar and that's wrong.
Try setColor() with NotificationCompat.Builder to set the accent color, which should be used by the colored circle behind the icon.
When I upload my image (which has no background to begin with), it is automatically given transparent background no matter what settings I choose. I really like the "Square" shape (rounded corners) but there is way too much excess transparent background. When I see the icon on my phone it looks so small compared to Facebook for example. How can I get rid of this extra background space to make it as large as possible? Is one of my settings off?
http://reiszecke.github.io/AndroidAssetStudioFullsize/
Just click on >> Launcher icons << Full Size edit
pls mark as answer if it helped.
EDIT: only works on "bevel" and "none", I will adjust the other shapes at some point
http://www.gieson.com/Library/projects/utilities/icon_slayer/
Does the job but the an image must be provided first.
Creating the logo and background with LIG and loading the result in the gieson's icon_slayer should do it.
Could someone point me to links and/or ideas on how to design a button similar to the android market "Install Button" using XML alone. i don't want to create something from gimp / photoshop and use it as android:src.
Please reference to the picture below from
http://howto.cnet.com/8301-11310_39-57329887-285/get-the-ice-cream-sandwich-keyboard-on-your-android-phone/
If you notice the installed button it has a white rectangle stroke, black rectangle border, filled with blue.
[Note: the above picture does not belong to me, and link has been pasted indicating the copyrighted owner. The picture has been quoted as reference solely for the purpose of demonstrating the "installed" button and nothing else]
You can do that with a linear layout with a white background, and a button with blue background inside. Give smaller values for button size, so it fits inside to leave some space so white borders are shown. User a selector for button, to change it's color in different states. More about selector here
I have some png image buttons that I use in my app. But they are showing up with grey backgrounds on my page. Does android always show a grey background for a transparent one? Is there a work around?
This is how it showed before.
This is how it shows after I made #FF000000 edits
This is how I want it to show.
EDIT:
Error when I use #FF: Color value not valid -- must be #rgb, #argb, #rrggbb, or #aarrggbb (at 'background' with value '#FF'). main.xml
#android:color/transparent. Phoenixblade9 was close.
If the image is transparent, there should be nothing shown behind the image.
The default colors vary from distribution to distribution. The color scheme/theme for an HTC phone will be different than from a Motorola phone, or the emulator.
If you want to ensure that a view has a transparent background, set the following in your XML code for that view:
android:background="#android:color/transparent"
This should ensure the background is completely transparent.
The code line in the ImageView or ImageButton in the XML file is actually:
android:background="#android:color/transparent"
I am writing this to help someone who is not familiar with the platform and won't connect the two answers above.
I found this happens if you have android:src="#drawable/mypngimage" in your xml file. Instead if you use background then the gray area goes away and it behaves as expected. android:background="#drawable/mypngimage"
Please check whether your image is 32 bit depth or not. After that insert this code in your image view: android:background="#android:color/transparent".
To make your image transparent open Adobe Photoshop or Illustrator, open file (i.e. your image) and click file and click to export - save as web (legacy), tick transparent and save it.
Also you can use #50FFFFFF (aarrggbb). in this format, aa is alpha channel to be transparency frequency. So If you use above color, you get a 50% transparent white background.