Is it possible to make layered button in Android with transparent icon throgh first layer? It looks tricky, I could make different assets but is it possible to achieve it programmatically? Example below
EDIT: Icon has no background, only border.
Seems easy enough. Save the icon as a .png file, such that anything besides the arrow outline is transparent. Then it's a simple matter of drawing one ImageView on top of another ImageView, depending on what you want.
In order to tint the arrow, use a TintableImageView as described here.
Related
I am using Delphi XE6. I have home screen of Android App. The Home screen contains Tbutton(s) with TImage(s) on top. I need to make TButton transparent and get rid of border of TImage.
I tried with Opacity property of TButton. But, the property is making even Image as transparent.
You can use only ImageView instead of Button and can perform action on image click..So you do not have to make button transparent.
You can use a Trectangle, it's work good on Windows and Android, no use a lot of resources.
You can apply a fill property to make it Transparent, you can also using a OnDraw method to copy a transparent bitmap to the canvas.
I brought two nine patch images from designer for action-bar list item background. But outside of item is black.
I add images in "android:itemBackground".
The below images have shadow effect.
I think the image is wrong because it has margin.
I wonder what is exact cause?
thank.
Image1:
Image2:
I think the designer intend to make shadow effect by using bg image. Because other app's overflow menu have shadow effect. But the effect is shown by framework. So I used an color drawable as background.
I've created this nine patch image.
I've used it as button background. In the button I've also put a text "back", but here is the result.
How can I put a text to the right of the arrow and let the image stretches in order to fit it?
(Don't worry about it's pixelated)
First of all as I can see you are creating the image in the wrong way. You can use this tool link . It's very useful at first steps.
Second of all in my opinion just remove that arrow from the background image. Leave it only
the yellow color with the gradient and add thet arrow as
android:drawableLeft="#drawable/my_arrow"
as element to your button in xml. That's the best option which I can think of.
i want to make a breadcrumb for my android app.
In breadcrumb on the left there is an imagebutton with arrow border. On the right there is a text title. When user tap on imagebutton, application performs specific task.
So, can you help me to create imagebutton with arrow border like in attach image?
Thank you.
I'm not 100% sure what you mean by an Arrow Border, but you cannot (as far as I know) set borders to any views in Android.
There are two options you could go for:
Make an outer View to surround the View you want a border on. Then set the background of the outer border to an arrow background.
Use a Nine Patch.
I would recommend a nine patch for this personally.
Edit: I noticed you wanted a border on an image. That could be an issue with nine patch unless you integrate the border into the image, which defeats the purpose.
I have an image that has a fairly large shadow around it and its background is transparent. I have saved it as a PNG file from photoshop and am using it in an ImageView through xml. This results in the shadow having a banding effect and just doesn't look nice. Not too sure what to do...
Just add
// set 32 bit window (draw correctly transparent images)
getWindow().getAttributes().format = android.graphics.PixelFormat.RGBA_8888;
in onCreate(...)
http://www.curious-creature.org/2010/12/08/bitmap-quality-banding-and-dithering/
I can't remember what this property was used on, but I think it was an ImageView.
Try using android:dither="true" as part of the ImageView xml declaration and see if that helps.
I can't remember where I read it, but on the developer site somewhere there was this suggestion for fixing gradient banding; it might help with the shadow as well. Right click the effects icon on the layer that has the shadow, and click "Create Layer" to make a separate layer for the shadow. Then apply an "Add Noise..." filter to the layer with the following settings:
(in case the image ever disappears, Amount:0.5%, Uniform, Monochromatic)