I want to apply shadow at bootom of ImageView as shown in image below.
Any trick to achieve that in android ??
The easiest way that I have seen to do this is to create an image that is just a drop shadow and then set that as the background for the container of your image.
Here is a really great SO thread about how to do just that.
No ,you have to create a image which have shadow as well as border.
so ,after that you have to set padding to your image so it's look like this frame.
Related
I want add shadow to layouts like below image :
http://s9.picofile.com/file/8321463292/android.png
I do not want use android:elevation, because not working for android 4.3
Also, I use these libraries but not work correct for me :
https://github.com/loopeer/shadow
https://github.com/dmytrodanylyk/shadow-layout
https://github.com/Devlight/ShadowLayout
https://github.com/harjot-oberai/MaterialShadows
https://github.com/xuehuayous/Android-ShadowView
How i can set shadow to layouts like top image ? ( smooth, 100% radius and colorful)
Thank you
I have two suggestions to make shadow as per your requirement
you can use 9-patch image, may be this link will help you to create 9-patch with shadow
alternate
solution is to make gradient and set background to your button view.
I have a imageView like this:
Primary Image
I want a this imageView margin like this:
Desired Image
Can this be possible?
I had a similar issue to this a while back actually, the best options I know of are to create your own shape using a Path or you could add a few shapes to a Pane of some sort and get a relatively similar shape like so
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 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)
I have a transparent listview with a image as background. Now, i want the scrollbar as transparent too, i.e I must be able to see the background image through this scrollbar too. Pls help!!!
Try this:
android:scrollbarThumbHorizontal="..."
android:scrollbarThumbVertical="..."
Where ... is a reference to your transparent drawable.
In your XML, if you add the line
android:scrollbars="none"
your ListView will still scroll, but have no visible scrollbars.
Check out the answer to this post:
scrollBar in a listView...customizing it.
They describe how to create a customized scrollbar with a given image. Your solution would be to create an image with some alpha value as to make it as transparent or as opaque as you want.
Oh yeah, make sure your image is a .PNG file as jpegs do not contain alpha information, so the cannot do transparency.