I want to create home layout with 6 button for menu
How can create this list with girdview or relative layout ?
my problem is when rotate screen relative layout don't work good and design not good
For a stylish looking of your Home page. its always recommended to use two layouts as
layout-land and layout. so that it will be better to look. Whether it may be Relative layout or Linear Layout or gridview use two layouts. Its not necessary but for the purpose of looking its recommended
Related
I have used both Linear and Relative layout . But still don't know excatly when to use which .
How to decide which one to use ? Explain with some example .
It's a personal preference for most of the cases.
You have to decide according to your necessity. You should however try to stick to RelativeLayout, if you are using multiple nested LinearLayouts since those can drop your performance noticeably.
See this tutorial. You'll have a good idea about different layouts. Hope this helps.. :)
This all depend on personal preferences and Experience matters a lot .
Personally i use combination of Linear layout in most of cases but sometimes FlowLayout and Relative Layout etc are used.
Linear Layout (vertical / Horizontal ) are used to create basic layout. Following properties help create view better and esthetic .
android:Layout_weight
Relative Layout is used to create overlay effect and also used to relate position of different Views according to position . Following properties help create view better and esthetic .
android:layout_margin
android:paddingLeft
android:paddingRight
android:paddingTop
android:paddingBottom
Frame Layout used to create Overlay layout like on option pressed etc.
also Frame Layout Can used to create overlay ads .
Grid Layout is used to create grid , you may have see gallery pics which are basically implemented in grid layout.
Example of Grid is Gallery Photos
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
Hello! I have just started playing with android layouts and i wonder if there is a general way of applying basic layout so that it will adjust itself to multiple screens and automatically to landscape view. For example:
In the picture above, I have added some buttons. Now what i want to learn is which layout or options(like weight,gravity,alignment) to b used so that they remain the same in Every view & on every screen. Some says to use linear layout within linear and then add weight and alignment. They said that by doing this, you have flexibility to remove any button and yet no other button looses its place(unlike in relative layout). Can there be better way that will have same layout on all screens and yet flexible??
You can use multiple linear layouts if you want to create a FORM.
otherwise Absolute layout is also good but not much preferable.
Relative layout needs practice, as you have to set widgets with respect to other.
multiple linear layouts may be useful.
RelativeLayout is very easy to use and if you learn to align the widgets in it, the layout will look the same on every screen BUT it's good for a layout that is very simple (few widgets on layout) or a layout that you know that will never change because changing on RelativeLayout is so hard and the best way is editing the XML not working on DesignView.
LinearLayout is not flexible like RelativeLayout but making change in it is so simple and other widgets will not lose their positions.
After all if you want to design layout for multiple screen size I recommend to use Fragments.
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.
I'm not really sure what tools I should be using to create a desired outcome...
At the bottom of the screen I would like to have three buttons, something like what is at the bottom of this screen except only using text instead of icons, and only having three options, not four.
Is this a tab view? I don't need a tab view because I don't need the tabs to stay on screen after one is clicked.
According to the layout source for the DeskClock they are indeed image buttons in a linear layout. The main layout source shows that the buttons are 'included' with the main layout. Hopefully this source helps.