I need to make an android layout like this one.
tile background all over the screen.
top menu which, overlays the background ( note the shadow ).
some sort of a table with text options, maybe pictures, which can be scrolled up and down.
bottom menu, which appears by sliding up after a menu button is hit.
What kind of layout elements do you think I should use for that?
Thanks!
I think you should first learn about the Android Layout and XML layout design, then you can easily prepare this layout as well.
Relative Layout will be the better layout as compare to other layouts like Linear Layout and Table Layout.
To display middle part that is showing textual description may contains ListView (ListView because as you have mentioned Text Options should scroll up and down), but it depends on your requirement.
The RelativeLayout is the most flexible, and I think you can make all this with a minimal hierarchy view depth.
My approach would be to use a RelativeLayout. The Top Menu bar could be a custom class which extends a LinearLayout and this can be used in the RelativeLayout (in fact in any screen you have to provide UI consistency). Similarly, the bottom menu would be a custom control containing the appropriate animations. The rest of the screen would be contained in a ScrollView, possibly containing a TableLayout. I have something very similar using a MapView in the main screen and it works fine.
Related
I am trying to design a layout similar to the one on the left image .
I thought this was a layout with one cardview for each section. However, I tried to put more than one cardview inside a LinearLayout orientation vertical and I only see one.
Why is that? Are cardviews are just meant to be used on RecyclerViews lists? If so, how can I achieve a layout design like these?
Reference for CardView. It is just a RelativeLayout with a rounded corners and a drop shadow. So yes, the image was probably an image of a layout designed with CardViews. At the same time, it could also just be a layout that was custom built and a shadow drawn behind it, if that developer wanted to do the work themselves. You can easily replicate the layout by creating this in xml, I can provide an example if necessary.
The CardView is not JUST designed for RecyclerView's but looks really good in a RecyclerView as the layout that is inflated IF a CardView layout makes sense to use. Again, it's just a RelativeLayout with extra features (rounded edges, and shadow)
I would work with a piece of layout that isn't shown, the user must scroll to see what I have did. How can I do it? Can I join 2 different layout in one? I prefer to collocate item as I do with default layout. If it can help, I use Android studio. I prefer use elements without code, adding them from palette. An example :
You can use two different layout in main relative layout & whenever u want child layout just set visibility.
You will want to use a ScrollView for this. From the documentation:
Layout container for a view hierarchy that can be scrolled by the user, allowing it to be larger than the physical display.
I am developing an application where i need icons to be floating on my panel. I am not sure which control and layout will be suitable for this. I am attaching an image to make you understand what i mean. I want the same two column icon based layout. And if i will scroll down it should be in a sliding way and scroll down. Please let me know which layout and control is suitable for sliding window where icons will be appearing in Android. I am new bie so i am sorry if its not a good question.
If you have a fixed number of items, you could simply use LinearLayouts (with a ScrollView as the root view of the layout). If you have a large number of items or you don't know in advance how many items you will have, use a GridView (and do not place it inside of a ScrollView).
I am interested to learn how to make this Layout (in Picture):
:
As you can see there are 2 Layouts and user can switch them with the button what is in upper right corner. Can someone learn me how to make this Layout?
I'd recommend you using SlidingMenu library.
That is exactly what you want.
It has numerous options, so you can customize the view you want to get behind.
The left menu is implemented with a library called SlidingMenu. In the sliding menu you can simply add normal layout / android ui components. So there is a ListView with items. The items are simple LinearLayouts with the correct weights, to achieve a "table like" layout.
There are two ViewTypes in the ListView. One is a normal Item, one is a section header (Linear Layout or Framelayout).
You could also use a RelativeLayout instead of LinearLayout, but Relative Layout are "more expensive" (performance) than a LinearLayout.
i think you had to customise viewpager layout .
set first layout width as u need to be shown.
sample view pager
I have some buttons, textboxes etc. in my android application, but when i drag them with my mouse in the xml file, their place doesn't change, or changes but they are not placed where i exactly wanted. How can i adjust their positions in the screen?
Thanks
Unfortunatly there is no such thing as absolute positionning in android ( RIP AbsoluteLayout deprecated since years.)
instead you have to position views according to their parents and according to other views in the same parent.
first you have to define wich parent you need ( if you want some viens in a single line go for a LinearLayout. a more custom layout: use a RelativeLayout ...)
then you can drag and drop views inside, but they will always snap a position relative to their parent and/or relative to the other views.
you can of course play with margins.
A list of layout type with some advanced techniques can be found on this page
Hope that helps.
You RelativeLayout as a group layout for your layout so positioning can somewhat easy using mouse.
Best is to arrange them from the xml code. Just Learn about using the Relative layout, LinearLayout and TableLayout
Learn how the XML works. For a LinearLayout, the items come in the order listed. For a RelativeLayout, the items are related by the values of their layout_XXX properties. Then you don't have to worry about the WYSIWYG tool not working.
FYI, the tool bundled with eclipse is extremely buggy. Don't count on whats on there being what's on your phone for anything non-trivial.
Like the others wrote it is easier to edit layout using xml editor. You can read more here http://developer.android.com/guide/topics/ui/declaring-layout.html.