i am trying to create the following UI in android app
In the above image all the five are to be image buttons. How to design this UI as like in the screen shot please help me friends....
Inside LinearLayout take RelativeLayout and make it centrally aligned.Then
Take first image Near me and set it's property.
Now take the second image Explore and set it to right of first image.
Place third image My network and place it below first image.
Fourth image Live set this to right of third image and and below second image.
Now center aligned your center image.
You will need to create 5 images, each of which has transparent areas. This layout type lets you position elements relative to the layout group itself, as well as to items within the group.
I'm not very familiar with Android advanced layout design, but the common layout objects give an idea:
There is a SurfaceView which gives you the ability to manipulate z-coördinates. In the SurfaceView you can then place a Grid/Relative/TableLayout for the 4 buttons (which you pre-render as rectangular images with transparency) and a simple Layout which centers and only contains the middle button.
If you then set the Z value of the first layout to less than that of the second you will get the view you want.
Related
In my application, i need to display a map of France, divided into 5 zones.
I did it with an image editor : i divided my map into 5 parts and save each part as a png. Each PNG has the same size.
Now, I add 5 ImageView (with the same size) in a RelativeLayout and i obtain this :
France Map 5 Parts
The goal is now to make clickable zones as described on the map. I don't know how to do this (which layout ? how to put them in my layout ?...)
Maybe RelativeLayout? You can place four background images in a regular way (using toLeftOf, toRightOf, below, ...) and one foreground image with alignParentTop and centerHorizontal set to true with proper layout_margins{Top, Left/Right}.
Also remember that android draws xml layouts from top to bottom, so your foreground image should be the last in layout file.
I am having four piece of image.
Here I attached one sample image.
How can I create the round shaped image using these type of images?
Which layout is best for creating the UI for android?
Thanks in advance.
are you talking about something like this..
http://www.baijs.nl/tinycircleslider/
And for designing the UI for Android is depends on our requirement.it means whether you want to design something looks like rows and columns then GridLayout and tableLayout will be better,depends on requirement and look the layout will changes once try it your self and choose the best suited for your applicaiton.All the best Mate
inside relative layout add four imageview with attrs ParentTop, ParentRight, ParentBottom and ParentLeft. every image is rectangular with transparent extra area.
i can understand it is little hard to visualize on first attempt.
now come to click area. so a runtime decision about ignore transparent area click will be right thing.
more tricky way will be manage flags for all listeners and if two listener get calls its transparent area .
I am creating an app which is a guide. I have a photograph showing an example, but I need to know, how can I make certain parts of the images clickable, to go to another activity to show more details about that thing.
Or have an image (which will be clicked) on top of the base image?
Thanks
have an image (which will be clicked) on top of the base image?
1 -
Can set the Background of Linear layout and add imageView in center of parent.
or
2- Use relative layout with tow image Views
You can split your main image on rectangular parts, then put them as ImageViews using RelativeLayout or TableLayout (which ever fits best in your case) so their combinations looks like a single image.
On each ImageView you can set a click listener using View.setOnClickListener(View.OnClickListener l)
a picture is worth a thousand words, so my question should basically be self-explanatory with the attached image: How to get rightmost screen instead of the center screen?
turns out i cannot attach images directly yet, so i have to link to it right now:
How to get rightmost screen instead of the center screen?
just to add, i realise that it is not really possible to have the framelayout NOT expand as shown in screen 2b, but my question remains as to how to achieve such an overlay without pushing the Other layouts down i.e. the bottom part of the imageview would be on top of the top right part of the other layouts
perhaps you could have the image you are dynamically adding be outside the frame layout. ie have a relative layout contain both framelayouts and the imageview – jkhouw1 1 hour ago
I saw this somewhere and was wondering how to achieve this.
suppose i have a shelf background
and i have cover images of books. how can i put those images exactly on each wodden plates edges dynamically.Number of books are not fixed they might go beyond the capacity of shelf then shelf will also grow. Each level of shelf contains maximum 3 cover images of book.
can i do this on background or do i need to draw a shelf on canvas or something else??
Once I tried this kind of UI , There might be several approach , My approach was ,
I had a list view with background as 3D shelf , not like the one which you have shown which has white color wall and other things. Background(3D shelf) which I used to fit entire screen , and space each row of list item exactly to the row of 3D shelf and in list items have 3 buttons with horizontal orientation.
There is already an app called Shelves , Check UI there , it is open source , code there might help you better
http://www.androidpolice.com/2010/08/19/app-of-the-week-shelvescatalogue-your-possessions/
You can achieve it. But you need to be very precise calculation for the width of shelf.
take FrameLayout. Now In this FrameLayout
take ImageView with this shelf image. Add it to FrameLayout
In FrameLayout, take 4 LinearLayouts with horizontal orientation for 4 shelves and adjust its height and left margin exactly as per shelf
add ImageViews of books in those LinearLayouts