i'm trying to add these kind of IOS shadows in the back of a imageview on Android:
I mean the rear shadow in the back of each square. Imagine that each square is an Android IMAGEVIEW, how can i add this shadow in Android?
Try this below link to your shadow problem
Custom ImageView with drop shadow
Welcome
Related
i am trying to coding the below image for android app design, i can not get shadow as same as image how i can do it perfectly? and can control with opacity, degree and color of shadow?
You can use cardView which has an elevation attribute which gives shadows to your card view.
also there are third party libraries which you can use like this:
https://github.com/loopeer/shadow
also here is Google documentation which describes how you should use shadows in your ui:
https://developer.android.com/training/material/shadows-clipping
I want to create a custom shaped button like below in android with xml(I know I can do it with the image but it isn't one of my options),how to do this?
I started with the rectangle shape and then tried to play with the corners in negative way to make the right side raise but I was unsuccessful.
You should use a 9-patch (resizable drawable) as your button background, read this.
I'm using the CardView layout from the v7 support library as a primary design pattern in my app. It works great on Lollipop as you'd expect and looks like this:
If I run this same app on 4.4 or below the content in the card doesn't go to the edge as seen here:
Is there a way that I can get the content to go to the edges on all versions of Android and not just 5.0?
Thanks
Unfortunately the creators of the CardView didn't come up with an efficient way to create rounded corners that would work for any layout on devices running earlier versions that Lollipop. Because of that, padding is simply added to the content of the cards. To prevent this padding use this method:
cardView.setPreventCornerOverlap(false);
If you do this however, the ImageView's corners will be drawn over the rounded corners of the CardView. A solution to this problem is to create a custom ImageView (or Drawable, or Picasso transfromation...) that draws rounded corners. Check this Gist on how to do that.
Since you are using a common layout for cards with a header image, you could check this library by the same author which creates the rounded corners without padding.
I am trying to implement the alignment feature ContentVertical Alignment found in ios for the android image button. It would be easier to use setGravity() however, image button does not support this method. Is there a way to work around this somehow?
Try scaleType attribute.
I am trying to draw and animate several ImageView items on a screen and I would like to have the images display the blue borders used in other Honeycomb apps (examples of borders here: http://www.youtube.com/watch?v=UPSBctbYc9Q # 1:10).
I've seen hacks/workarounds for older versions of Android using a background image, but I was hoping to avoid that. Can anyone help me to add such borders?
Thanks
I'd suggest just creating a custom view using FrameLayout as its base to layer up the background/border, and then the ImageView on top using an appropriate padding value such that the border remains visible.