I'm new in android design.
I want to create a view like this:
In fact, I want to create two things:
A header like this image header that has an image with a transparent overlay.
Like my header, I want to create recyclerview items, with image and transparent overlay too.
It is necessary to mention that, I want to use Picasso library to show my images.
How to I create this.
Thanks a lot.
For grid element you can use RelativeLayout. On the first layer put ImageView with your image, above this you can put View with overlay background (for example semi-transparent black color), and then you can add your text. If you want to create text like on your image (two TextViews above center) you can put empty View element with some height (this height will be like margin between two TextViews) and in top text add layoutAbove="centerViewId" and in bottom text: layoutBelow="centerViewId". I can paste xml code if you want, but I think in this way will teach you more.
Related
I want to create a custom shaped button like this:
I'm able to achieve a similar thing by using a RelativeLayout and overlapping a rectangle and a circle. But that way, I have to add 2 onClickListaners, one for each shape.
Is there a way in android ( other than using an image, because in image the entire rectangular view will be clickable and not just the button ) to create such a design using a single XML layout file ??
you won't have to make two listener just make one listener for the RelativeLayout
I want to make a custom layout like below view.
In this view I want to make TextView half sliced from one end and another ImageView from another end. So please tell me how to make such custom TextView and ImageView with diagonal clipped from one side.
With reference from this answer you can use this view and customize it horizontally instead of vertical.
Or you can also check for this code as well which something like below image.
Reference also available here
I want to create android buttons but the look something like the one in picture.
Normal android buttons are curved and their boarder are not joined... I want my layou
Is there a way to create a layout like this?
You can turn any ImageView into a button by setting an onClickListener on it.
Edit to better answer the question: The layout you show can be created by putting a bunch of ImageViews in a horizontal LinearLayout. The LinearLayout has a blue background. The images that provide the sources for the ImageViews have a transparent background.
Buttons are just TextViews extensions. You just have to change its background with a xml drawable which has three states
I'm working on my first Android application and I have a pretty good idea of what I want my application to look like, I'm just not sure how to create the view.
I have a Listview with several items, I then want users to click on an item then get a detail page. I want my detail page to look like this.
I know how to get the background. What I'm trying to figure out is what's the best way to create that rounded, see-through table with a border. Any ideas?
The easiest way would be to create a linear layout with vertical orientation and define a drawable shape resource and set the corners to have a radius to match what you like. Then add your 2 text views and an image view and lines for the separators.
EDIT: Solved this by from Java-code adding headers and footers with transparent background to the ListView.
Hi, I'm trying to make a ListView that has a gradient as a background and the content inside a frame. I have some screenshots of what I'm trying to acheive.
The first screenshots shows how I want it too look from start. The list is shown in a box with rounded corners and a green background. This is acheived by adding padding to the LinearLayout surronding the ListView. However, when I add padding on top, the scrolling looks like in the third picture, which is not what I want. The first field with name and phonenumber is a header for the listview.
Any suggestions on how to make the listview behave like this?
You should use Relative layout for solving this problem.